{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Run model module locally with labeled threshold tuning"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "# Import os environment variables for global sequence shape hyperparameters\n",
    "os.environ[\"SEQ_LEN\"] = str(30)\n",
    "os.environ[\"NUM_FEAT\"] = str(5)\n",
    "\n",
    "# Import os environment variables for global feature hyperparameters\n",
    "os.environ[\"FEAT_NAMES\"] = (\",\").join([\"tag_{}\".format(i) for i in range(int(os.environ[\"NUM_FEAT\"]))])\n",
    "os.environ[\"FEAT_DEFAULTS\"] = (\",\").join([(\";\").join([\"0.0\"] * int(os.environ[\"SEQ_LEN\"]))] * int(os.environ[\"NUM_FEAT\"]))\n",
    "\n",
    "# Import os environment variables for global training hyperparameters\n",
    "os.environ[\"START_DELAY_SECS\"] = str(60)\n",
    "os.environ[\"THROTTLE_SECS\"] = str(120)\n",
    "\n",
    "# Import os environment variables for global threshold hyperparameters\n",
    "os.environ[\"LABELED_TUNE_THRESH\"] = \"True\"\n",
    "os.environ[\"NUM_TIME_ANOM_THRESH\"] = str(300)\n",
    "os.environ[\"NUM_FEAT_ANOM_THRESH\"] = str(300)\n",
    "\n",
    "# Import global dense hyperparameters\n",
    "os.environ[\"ENC_DNN_HIDDEN_UNITS\"] = \"64,32,16\"\n",
    "os.environ[\"LATENT_VECTOR_SIZE\"] = str(8)\n",
    "os.environ[\"DEC_DNN_HIDDEN_UNITS\"] = \"16,32,64\"\n",
    "os.environ[\"TIME_LOSS_WEIGHT\"] = str(1.0)\n",
    "os.environ[\"FEAT_LOSS_WEIGHT\"] = str(1.0)\n",
    "\n",
    "# Import global lstm hyperparameters\n",
    "os.environ[\"REVERSE_LABELS_SEQUENCE\"] = \"True\"\n",
    "os.environ[\"ENC_LSTM_HIDDEN_UNITS\"] = \"64,32,16\"\n",
    "os.environ[\"DEC_LSTM_HIDDEN_UNITS\"] = \"16,32,64\"\n",
    "os.environ[\"LSTM_DROPOUT_OUTPUT_KEEP_PROBS\"] = \"0.9,0.95,1.0\"\n",
    "os.environ[\"DNN_HIDDEN_UNITS\"] = \"1024,256,64\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Train reconstruction variables"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Import os environment variables for reconstruction training hyperparameters\n",
    "os.environ[\"TRAIN_FILE_PATTERN\"] = \"data/train_norm_seq.csv\"\n",
    "os.environ[\"EVAL_FILE_PATTERN\"] = \"data/val_norm_1_seq.csv\"\n",
    "os.environ[\"PREVIOUS_TRAIN_STEPS\"] = str(0)\n",
    "os.environ[\"RECONSTRUCTION_EPOCHS\"] = str(1.0)\n",
    "os.environ[\"TRAIN_EXAMPLES\"] = str(64000)\n",
    "os.environ[\"LEARNING_RATE\"] = str(0.1)\n",
    "os.environ[\"TRAINING_MODE\"] = \"reconstruction\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Dense Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
      "For more information, please see:\n",
      "  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
      "  * https://github.com/tensorflow/addons\n",
      "If you depend on functionality not listed there, please file an issue.\n",
      "\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "train\n",
      "anomaly_detection: params = \n",
      "{'eval_examples': 1024, 'enc_dnn_hidden_units': [64, 32, 16], 'num_feat': 5, 'eps': 1e-12, 'dec_lstm_hidden_units': [16, 32, 64], 'reconstruction_epochs': 1.0, 'latent_vector_size': 8, 'seq_len': 30, 'train_batch_size': 32, 'time_loss_weight': 1.0, 'dec_dnn_hidden_units': [16, 32, 64], 'max_time_anom_thresh': 2000.0, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'previous_train_steps': 0, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'f_score_beta': 0.05, 'throttle_secs': 120, 'autotune_principal_components': False, 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'num_feat_anom_thresh': 300, 'training_mode': 'reconstruction', 'eval_batch_size': 32, 'time_anom_thresh': None, 'k_principal_components_feat': None, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'train_file_pattern': 'data/train_norm_seq.csv', 'model_type': 'dense_autoencoder', 'min_time_anom_thresh': 100.0, 'train_examples': 64000, 'enc_lstm_hidden_units': [64, 32, 16], 'max_feat_anom_thresh': 2000.0, 'start_delay_secs': 60, 'feat_thresh_scl': 2.0, 'reverse_labels_sequence': True, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/', 'num_time_anom_thresh': 300, 'k_principal_components_time': None, 'time_thresh_scl': 2.0, 'feat_loss_weight': 1.0, 'min_feat_anom_thresh': 100.0, 'learning_rate': 0.1, 'feat_anom_thresh': None, 'dnn_hidden_units': [1024, 256, 64], 'labeled_tune_thresh': True}\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "eval\n",
      "anomaly_detection: params = \n",
      "{'eval_examples': 1024, 'enc_dnn_hidden_units': [64, 32, 16], 'num_feat': 5, 'eps': 1e-12, 'dec_lstm_hidden_units': [16, 32, 64], 'reconstruction_epochs': 1.0, 'latent_vector_size': 8, 'seq_len': 30, 'train_batch_size': 32, 'time_loss_weight': 1.0, 'dec_dnn_hidden_units': [16, 32, 64], 'max_time_anom_thresh': 2000.0, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'previous_train_steps': 0, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'f_score_beta': 0.05, 'throttle_secs': 120, 'autotune_principal_components': False, 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'num_feat_anom_thresh': 300, 'training_mode': 'reconstruction', 'eval_batch_size': 32, 'time_anom_thresh': None, 'k_principal_components_feat': None, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'train_file_pattern': 'data/train_norm_seq.csv', 'model_type': 'dense_autoencoder', 'min_time_anom_thresh': 100.0, 'train_examples': 64000, 'enc_lstm_hidden_units': [64, 32, 16], 'max_feat_anom_thresh': 2000.0, 'start_delay_secs': 60, 'feat_thresh_scl': 2.0, 'reverse_labels_sequence': True, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/', 'num_time_anom_thresh': 300, 'k_principal_components_time': None, 'time_thresh_scl': 2.0, 'feat_loss_weight': 1.0, 'min_feat_anom_thresh': 100.0, 'learning_rate': 0.1, 'feat_anom_thresh': None, 'dnn_hidden_units': [1024, 256, 64], 'labeled_tune_thresh': True}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using default config.\n",
      "INFO:tensorflow:Using config: {'_tf_random_seed': None, '_evaluation_master': '', '_save_summary_steps': 100, '_task_type': 'worker', '_keep_checkpoint_every_n_hours': 10000, '_num_worker_replicas': 1, '_eval_distribute': None, '_task_id': 0, '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_log_step_count_steps': 100, '_device_fn': None, '_save_checkpoints_steps': None, '_model_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/', '_experimental_distribute': None, '_global_id_in_cluster': 0, '_service': None, '_protocol': None, '_is_chief': True, '_num_ps_replicas': 0, '_master': '', '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7fd02187e668>, '_keep_checkpoint_max': 5, '_save_checkpoints_secs': 600, '_train_distribute': None}\n",
      "INFO:tensorflow:Not using Distribute Coordinator.\n",
      "INFO:tensorflow:Running training and evaluation locally (non-distributed).\n",
      "INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after every checkpoint. Checkpoint frequency is determined based on RunConfig arguments: save_checkpoints_steps None or save_checkpoints_secs 600.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_dense.py:27: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use keras.layers.dense instead.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/losses/losses_impl.py:667: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Create CheckpointSaverHook.\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "2019-07-12 20:16:38.087057: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
      "2019-07-12 20:16:38.093800: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:16:38.095213: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x561725d82870 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:16:38.095249: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Saving checkpoints for 0 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt.\n",
      "INFO:tensorflow:loss = 1.368325, step = 1\n",
      "INFO:tensorflow:global_step/sec: 65.7212\n",
      "INFO:tensorflow:loss = 0.4446596, step = 101 (1.522 sec)\n",
      "INFO:tensorflow:global_step/sec: 75.7314\n",
      "INFO:tensorflow:loss = 0.57289237, step = 201 (1.320 sec)\n",
      "INFO:tensorflow:global_step/sec: 75.7962\n",
      "INFO:tensorflow:loss = 0.7039242, step = 301 (1.319 sec)\n",
      "INFO:tensorflow:global_step/sec: 75.9595\n",
      "INFO:tensorflow:loss = 0.7111818, step = 401 (1.316 sec)\n",
      "INFO:tensorflow:global_step/sec: 76.915\n",
      "INFO:tensorflow:loss = 0.69844663, step = 501 (1.300 sec)\n",
      "INFO:tensorflow:global_step/sec: 76.2256\n",
      "INFO:tensorflow:loss = 0.7039294, step = 601 (1.312 sec)\n",
      "INFO:tensorflow:global_step/sec: 77.4986\n",
      "INFO:tensorflow:loss = 0.6737489, step = 701 (1.290 sec)\n",
      "INFO:tensorflow:global_step/sec: 76.2604\n",
      "INFO:tensorflow:loss = 0.6880377, step = 801 (1.311 sec)\n",
      "INFO:tensorflow:global_step/sec: 76.6107\n",
      "INFO:tensorflow:loss = 0.6870008, step = 901 (1.305 sec)\n",
      "INFO:tensorflow:global_step/sec: 76.2689\n",
      "INFO:tensorflow:loss = 0.9489514, step = 1001 (1.311 sec)\n",
      "INFO:tensorflow:global_step/sec: 76.6596\n",
      "INFO:tensorflow:loss = 0.9395068, step = 1101 (1.305 sec)\n",
      "INFO:tensorflow:global_step/sec: 76.9783\n",
      "INFO:tensorflow:loss = 0.9340743, step = 1201 (1.299 sec)\n",
      "INFO:tensorflow:global_step/sec: 70.5836\n",
      "INFO:tensorflow:loss = 0.93109936, step = 1301 (1.417 sec)\n",
      "INFO:tensorflow:global_step/sec: 70.9854\n",
      "INFO:tensorflow:loss = 0.9376575, step = 1401 (1.409 sec)\n",
      "INFO:tensorflow:global_step/sec: 71.7445\n",
      "INFO:tensorflow:loss = 0.9365275, step = 1501 (1.394 sec)\n",
      "INFO:tensorflow:global_step/sec: 72.3847\n",
      "INFO:tensorflow:loss = 0.92577535, step = 1601 (1.381 sec)\n",
      "INFO:tensorflow:global_step/sec: 72.9024\n",
      "INFO:tensorflow:loss = 0.9446332, step = 1701 (1.372 sec)\n",
      "INFO:tensorflow:global_step/sec: 56.5897\n",
      "INFO:tensorflow:loss = 0.9325291, step = 1801 (1.767 sec)\n",
      "INFO:tensorflow:global_step/sec: 54.8562\n",
      "INFO:tensorflow:loss = 0.934411, step = 1901 (1.823 sec)\n",
      "INFO:tensorflow:Saving checkpoints for 2000 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Starting evaluation at 2019-07-12T20:17:10Z\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt-2000\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Finished evaluation at 2019-07-12-20:17:13\n",
      "INFO:tensorflow:Saving dict for global step 2000: global_step = 2000, loss = 1.3207021, mae = 0.9642817, rmse = 1.1492178\n",
      "INFO:tensorflow:Saving 'checkpoint_path' summary for global step 2000: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt-2000\n",
      "INFO:tensorflow:Loss for final step: 0.9396997.\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "rm -rf trained_model/dense_labeled\n",
    "export PYTHONPATH=$PYTHONPATH:$PWD/anomaly_detection_module\n",
    "python3 -m trainer.task \\\n",
    "  --train_file_pattern=$TRAIN_FILE_PATTERN \\\n",
    "  --eval_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --output_dir=$PWD/trained_model/dense_labeled \\\n",
    "  --job-dir=./tmp \\\n",
    "  --seq_len=$SEQ_LEN \\\n",
    "  --num_feat=$NUM_FEAT \\\n",
    "  --feat_names=$FEAT_NAMES \\\n",
    "  --feat_defaults=$FEAT_DEFAULTS \\\n",
    "  --train_batch_size=32 \\\n",
    "  --eval_batch_size=32 \\\n",
    "  --previous_train_steps=$PREVIOUS_TRAIN_STEPS \\\n",
    "  --reconstruction_epochs=$RECONSTRUCTION_EPOCHS \\\n",
    "  --train_examples=$TRAIN_EXAMPLES \\\n",
    "  --learning_rate=$LEARNING_RATE \\\n",
    "  --start_delay_secs=$START_DELAY_SECS \\\n",
    "  --throttle_secs=$THROTTLE_SECS \\\n",
    "  --model_type=\"dense_autoencoder\" \\\n",
    "  --enc_dnn_hidden_units=$ENC_DNN_HIDDEN_UNITS \\\n",
    "  --latent_vector_size=$LATENT_VECTOR_SIZE \\\n",
    "  --dec_dnn_hidden_units=$DEC_DNN_HIDDEN_UNITS \\\n",
    "  --time_loss_weight=$TIME_LOSS_WEIGHT \\\n",
    "  --feat_loss_weight=$FEAT_LOSS_WEIGHT \\\n",
    "  --training_mode=$TRAINING_MODE \\\n",
    "  --labeled_tune_thresh=$LABELED_TUNE_THRESH \\\n",
    "  --num_time_anom_thresh=$NUM_TIME_ANOM_THRESH \\\n",
    "  --num_feat_anom_thresh=$NUM_FEAT_ANOM_THRESH"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### LSTM Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
      "For more information, please see:\n",
      "  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
      "  * https://github.com/tensorflow/addons\n",
      "If you depend on functionality not listed there, please file an issue.\n",
      "\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "train\n",
      "anomaly_detection: params = \n",
      "{'num_feat_anom_thresh': 300, 'reverse_labels_sequence': True, 'model_type': 'lstm_enc_dec_autoencoder', 'lstm_dropout_output_keep_probs': [0.9, 0.95, 1.0], 'num_feat': 5, 'eps': 1e-12, 'time_thresh_scl': 2.0, 'max_feat_anom_thresh': 2000.0, 'train_file_pattern': 'data/train_norm_seq.csv', 'feat_loss_weight': 1.0, 'k_principal_components_feat': None, 'latent_vector_size': 8, 'dec_lstm_hidden_units': [16, 32, 64], 'train_examples': 64000, 'min_feat_anom_thresh': 100.0, 'seq_len': 30, 'min_time_anom_thresh': 100.0, 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'start_delay_secs': 60, 'time_loss_weight': 1.0, 'throttle_secs': 120, 'train_batch_size': 32, 'training_mode': 'reconstruction', 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'eval_examples': 1024, 'autotune_principal_components': False, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'labeled_tune_thresh': True, 'max_time_anom_thresh': 2000.0, 'k_principal_components_time': None, 'dec_dnn_hidden_units': [64, 256, 1024], 'previous_train_steps': 0, 'dnn_hidden_units': [1024, 256, 64], 'time_anom_thresh': None, 'num_time_anom_thresh': 300, 'feat_anom_thresh': None, 'feat_thresh_scl': 2.0, 'eval_batch_size': 32, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/', 'enc_dnn_hidden_units': [1024, 256, 64], 'enc_lstm_hidden_units': [64, 32, 16], 'learning_rate': 0.1, 'reconstruction_epochs': 1.0, 'f_score_beta': 0.05}\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "eval\n",
      "anomaly_detection: params = \n",
      "{'num_feat_anom_thresh': 300, 'reverse_labels_sequence': True, 'model_type': 'lstm_enc_dec_autoencoder', 'lstm_dropout_output_keep_probs': [0.9, 0.95, 1.0], 'num_feat': 5, 'eps': 1e-12, 'time_thresh_scl': 2.0, 'max_feat_anom_thresh': 2000.0, 'train_file_pattern': 'data/train_norm_seq.csv', 'feat_loss_weight': 1.0, 'k_principal_components_feat': None, 'latent_vector_size': 8, 'dec_lstm_hidden_units': [16, 32, 64], 'train_examples': 64000, 'min_feat_anom_thresh': 100.0, 'seq_len': 30, 'min_time_anom_thresh': 100.0, 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'start_delay_secs': 60, 'time_loss_weight': 1.0, 'throttle_secs': 120, 'train_batch_size': 32, 'training_mode': 'reconstruction', 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'eval_examples': 1024, 'autotune_principal_components': False, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'labeled_tune_thresh': True, 'max_time_anom_thresh': 2000.0, 'k_principal_components_time': None, 'dec_dnn_hidden_units': [64, 256, 1024], 'previous_train_steps': 0, 'dnn_hidden_units': [1024, 256, 64], 'time_anom_thresh': None, 'num_time_anom_thresh': 300, 'feat_anom_thresh': None, 'feat_thresh_scl': 2.0, 'eval_batch_size': 32, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/', 'enc_dnn_hidden_units': [1024, 256, 64], 'enc_lstm_hidden_units': [64, 32, 16], 'learning_rate': 0.1, 'reconstruction_epochs': 1.0, 'f_score_beta': 0.05}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using default config.\n",
      "INFO:tensorflow:Using config: {'_save_summary_steps': 100, '_service': None, '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_master': '', '_keep_checkpoint_every_n_hours': 10000, '_train_distribute': None, '_num_worker_replicas': 1, '_experimental_distribute': None, '_eval_distribute': None, '_is_chief': True, '_model_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/', '_keep_checkpoint_max': 5, '_evaluation_master': '', '_tf_random_seed': None, '_task_type': 'worker', '_save_checkpoints_steps': None, '_global_id_in_cluster': 0, '_task_id': 0, '_num_ps_replicas': 0, '_protocol': None, '_device_fn': None, '_save_checkpoints_secs': 600, '_log_step_count_steps': 100, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7fe784e48208>}\n",
      "INFO:tensorflow:Not using Distribute Coordinator.\n",
      "INFO:tensorflow:Running training and evaluation locally (non-distributed).\n",
      "INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after every checkpoint. Checkpoint frequency is determined based on RunConfig arguments: save_checkpoints_steps None or save_checkpoints_secs 600.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:26: BasicLSTMCell.__init__ (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This class is equivalent as tf.keras.layers.LSTMCell, and will be replaced by that in Tensorflow 2.0.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:41: MultiRNNCell.__init__ (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This class is equivalent as tf.keras.layers.StackedRNNCells, and will be replaced by that in Tensorflow 2.0.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:207: static_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Please use `keras.layers.RNN(cell, unroll=True)`, which is equivalent to this API\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py:1259: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:225: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use keras.layers.dense instead.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/losses/losses_impl.py:667: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Create CheckpointSaverHook.\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "2019-07-12 20:21:14.945425: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
      "2019-07-12 20:21:14.952084: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:21:14.953246: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x5638f3a9e100 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:21:14.953287: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Saving checkpoints for 0 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt.\n",
      "INFO:tensorflow:loss = 1.3623496, step = 1\n",
      "INFO:tensorflow:global_step/sec: 4.36641\n",
      "INFO:tensorflow:loss = 2.0607471, step = 101 (22.902 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.3116\n",
      "INFO:tensorflow:loss = 2.0030136, step = 201 (7.512 sec)\n",
      "INFO:tensorflow:global_step/sec: 11.3968\n",
      "INFO:tensorflow:loss = 1.9277266, step = 301 (8.774 sec)\n",
      "INFO:tensorflow:global_step/sec: 12.9144\n",
      "INFO:tensorflow:loss = 1.8352336, step = 401 (7.743 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.3424\n",
      "INFO:tensorflow:loss = 1.8011149, step = 501 (7.495 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.2531\n",
      "INFO:tensorflow:loss = 1.7036313, step = 601 (7.545 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.3478\n",
      "INFO:tensorflow:loss = 1.592574, step = 701 (7.492 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.33\n",
      "INFO:tensorflow:loss = 1.5191653, step = 801 (7.502 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.2397\n",
      "INFO:tensorflow:loss = 1.4588434, step = 901 (7.553 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.3702\n",
      "INFO:tensorflow:loss = 1.3700745, step = 1001 (7.480 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.4512\n",
      "INFO:tensorflow:loss = 1.3210671, step = 1101 (7.434 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.474\n",
      "INFO:tensorflow:loss = 1.2646065, step = 1201 (7.422 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.5018\n",
      "INFO:tensorflow:loss = 1.2339752, step = 1301 (7.406 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.374\n",
      "INFO:tensorflow:loss = 1.1937267, step = 1401 (7.477 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.417\n",
      "INFO:tensorflow:loss = 1.1558093, step = 1501 (7.453 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.4214\n",
      "INFO:tensorflow:loss = 1.1419057, step = 1601 (7.451 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.2842\n",
      "INFO:tensorflow:loss = 1.1327248, step = 1701 (7.528 sec)\n",
      "INFO:tensorflow:global_step/sec: 12.4307\n",
      "INFO:tensorflow:loss = 1.1189774, step = 1801 (8.045 sec)\n",
      "INFO:tensorflow:global_step/sec: 13.339\n",
      "INFO:tensorflow:loss = 1.0980394, step = 1901 (7.497 sec)\n",
      "INFO:tensorflow:Saving checkpoints for 2000 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Starting evaluation at 2019-07-12T20:24:38Z\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt-2000\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Finished evaluation at 2019-07-12-20:24:56\n",
      "INFO:tensorflow:Saving dict for global step 2000: global_step = 2000, loss = 1.1017623, mae = 0.9088944, rmse = 1.0496485\n",
      "INFO:tensorflow:Saving 'checkpoint_path' summary for global step 2000: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt-2000\n",
      "INFO:tensorflow:Loss for final step: 1.1030915.\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "rm -rf trained_model/lstm_labeled\n",
    "export PYTHONPATH=$PYTHONPATH:$PWD/anomaly_detection_module\n",
    "python3 -m trainer.task \\\n",
    "  --train_file_pattern=$TRAIN_FILE_PATTERN \\\n",
    "  --eval_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --output_dir=$PWD/trained_model/lstm_labeled \\\n",
    "  --job-dir=./tmp \\\n",
    "  --seq_len=$SEQ_LEN \\\n",
    "  --num_feat=$NUM_FEAT \\\n",
    "  --feat_names=$FEAT_NAMES \\\n",
    "  --feat_defaults=$FEAT_DEFAULTS \\\n",
    "  --train_batch_size=32 \\\n",
    "  --eval_batch_size=32 \\\n",
    "  --previous_train_steps=$PREVIOUS_TRAIN_STEPS \\\n",
    "  --reconstruction_epochs=$RECONSTRUCTION_EPOCHS \\\n",
    "  --train_examples=$TRAIN_EXAMPLES \\\n",
    "  --learning_rate=$LEARNING_RATE \\\n",
    "  --start_delay_secs=$START_DELAY_SECS \\\n",
    "  --throttle_secs=$THROTTLE_SECS \\\n",
    "  --model_type=\"lstm_enc_dec_autoencoder\" \\\n",
    "  --reverse_labels_sequence=$REVERSE_LABELS_SEQUENCE \\\n",
    "  --enc_lstm_hidden_units=$ENC_LSTM_HIDDEN_UNITS \\\n",
    "  --dec_lstm_hidden_units=$DEC_LSTM_HIDDEN_UNITS \\\n",
    "  --lstm_dropout_output_keep_probs=$LSTM_DROPOUT_OUTPUT_KEEP_PROBS \\\n",
    "  --dnn_hidden_units=$DNN_HIDDEN_UNITS \\\n",
    "  --training_mode=$TRAINING_MODE \\\n",
    "  --labeled_tune_thresh=$LABELED_TUNE_THRESH \\\n",
    "  --num_time_anom_thresh=$NUM_TIME_ANOM_THRESH \\\n",
    "  --num_feat_anom_thresh=$NUM_FEAT_ANOM_THRESH"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### PCA Autoencoder"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Reconstruction"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "train\n",
      "anomaly_detection: params = \n",
      "{'f_score_beta': 0.05, 'reverse_labels_sequence': True, 'num_feat': 5, 'eval_examples': 6400, 'eps': 1e-12, 'training_mode': 'reconstruction', 'k_principal_components_time': None, 'train_examples': 64000, 'start_delay_secs': 60, 'throttle_secs': 120, 'feat_loss_weight': 1.0, 'reconstruction_epochs': 1.0, 'num_time_anom_thresh': 300, 'time_anom_thresh': None, 'dec_lstm_hidden_units': [16, 32, 64], 'dec_dnn_hidden_units': [64, 256, 1024], 'min_feat_anom_thresh': 100.0, 'feat_thresh_scl': 2.0, 'labeled_tune_thresh': True, 'seq_len': 30, 'enc_dnn_hidden_units': [1024, 256, 64], 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'train_batch_size': 32, 'previous_train_steps': 0, 'time_loss_weight': 1.0, 'max_feat_anom_thresh': 2000.0, 'time_thresh_scl': 2.0, 'model_type': 'pca', 'num_feat_anom_thresh': 300, 'learning_rate': 0.1, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'eval_batch_size': 32, 'dnn_hidden_units': [1024, 256, 64], 'k_principal_components_feat': None, 'feat_anom_thresh': None, 'enc_lstm_hidden_units': [64, 32, 16], 'latent_vector_size': 8, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'min_time_anom_thresh': 100.0, 'train_file_pattern': 'data/train_norm_seq.csv', 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'autotune_principal_components': False, 'max_time_anom_thresh': 2000.0}\n",
      "\n",
      "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
      "For more information, please see:\n",
      "  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
      "  * https://github.com/tensorflow/addons\n",
      "If you depend on functionality not listed there, please file an issue.\n",
      "\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "eval\n",
      "anomaly_detection: params = \n",
      "{'f_score_beta': 0.05, 'reverse_labels_sequence': True, 'num_feat': 5, 'eval_examples': 6400, 'eps': 1e-12, 'training_mode': 'reconstruction', 'k_principal_components_time': None, 'train_examples': 64000, 'start_delay_secs': 60, 'throttle_secs': 120, 'feat_loss_weight': 1.0, 'reconstruction_epochs': 1.0, 'num_time_anom_thresh': 300, 'time_anom_thresh': None, 'dec_lstm_hidden_units': [16, 32, 64], 'dec_dnn_hidden_units': [64, 256, 1024], 'min_feat_anom_thresh': 100.0, 'feat_thresh_scl': 2.0, 'labeled_tune_thresh': True, 'seq_len': 30, 'enc_dnn_hidden_units': [1024, 256, 64], 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'train_batch_size': 32, 'previous_train_steps': 0, 'time_loss_weight': 1.0, 'max_feat_anom_thresh': 2000.0, 'time_thresh_scl': 2.0, 'model_type': 'pca', 'num_feat_anom_thresh': 300, 'learning_rate': 0.1, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'eval_batch_size': 32, 'dnn_hidden_units': [1024, 256, 64], 'k_principal_components_feat': None, 'feat_anom_thresh': None, 'enc_lstm_hidden_units': [64, 32, 16], 'latent_vector_size': 8, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'min_time_anom_thresh': 100.0, 'train_file_pattern': 'data/train_norm_seq.csv', 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'autotune_principal_components': False, 'max_time_anom_thresh': 2000.0}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using default config.\n",
      "INFO:tensorflow:Using config: {'_eval_distribute': None, '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_save_summary_steps': 100, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f6d988c1390>, '_experimental_distribute': None, '_service': None, '_protocol': None, '_master': '', '_global_id_in_cluster': 0, '_save_checkpoints_secs': 600, '_log_step_count_steps': 100, '_model_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', '_tf_random_seed': None, '_is_chief': True, '_num_ps_replicas': 0, '_save_checkpoints_steps': None, '_device_fn': None, '_keep_checkpoint_max': 5, '_train_distribute': None, '_task_id': 0, '_task_type': 'worker', '_keep_checkpoint_every_n_hours': 10000, '_evaluation_master': '', '_num_worker_replicas': 1}\n",
      "INFO:tensorflow:Not using Distribute Coordinator.\n",
      "INFO:tensorflow:Running training and evaluation locally (non-distributed).\n",
      "INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after every checkpoint. Checkpoint frequency is determined based on RunConfig arguments: save_checkpoints_steps None or save_checkpoints_secs 600.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Create CheckpointSaverHook.\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "2019-07-12 20:37:50.427503: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
      "2019-07-12 20:37:50.434816: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:37:50.437003: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x5583ee5aae10 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:37:50.437055: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Saving checkpoints for 0 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt.\n",
      "INFO:tensorflow:loss = 0.0, step = 1\n",
      "INFO:tensorflow:global_step/sec: 77.0416\n",
      "INFO:tensorflow:loss = 0.0, step = 101 (1.299 sec)\n",
      "INFO:tensorflow:global_step/sec: 80.4536\n",
      "INFO:tensorflow:loss = 0.0, step = 201 (1.243 sec)\n",
      "INFO:tensorflow:global_step/sec: 84.4436\n",
      "INFO:tensorflow:loss = 0.0, step = 301 (1.184 sec)\n",
      "INFO:tensorflow:global_step/sec: 81.4629\n",
      "INFO:tensorflow:loss = 0.0, step = 401 (1.228 sec)\n",
      "INFO:tensorflow:global_step/sec: 84.6646\n",
      "INFO:tensorflow:loss = 0.0, step = 501 (1.181 sec)\n",
      "INFO:tensorflow:global_step/sec: 81.9868\n",
      "INFO:tensorflow:loss = 0.0, step = 601 (1.220 sec)\n",
      "INFO:tensorflow:global_step/sec: 83.1199\n",
      "INFO:tensorflow:loss = 0.0, step = 701 (1.203 sec)\n",
      "INFO:tensorflow:global_step/sec: 106.595\n",
      "INFO:tensorflow:loss = 0.0, step = 801 (0.938 sec)\n",
      "INFO:tensorflow:global_step/sec: 118.519\n",
      "INFO:tensorflow:loss = 0.0, step = 901 (0.844 sec)\n",
      "INFO:tensorflow:global_step/sec: 116.905\n",
      "INFO:tensorflow:loss = 0.0, step = 1001 (0.856 sec)\n",
      "INFO:tensorflow:global_step/sec: 117.259\n",
      "INFO:tensorflow:loss = 0.0, step = 1101 (0.853 sec)\n",
      "INFO:tensorflow:global_step/sec: 118.889\n",
      "INFO:tensorflow:loss = 0.0, step = 1201 (0.841 sec)\n",
      "INFO:tensorflow:global_step/sec: 124.446\n",
      "INFO:tensorflow:loss = 0.0, step = 1301 (0.803 sec)\n",
      "INFO:tensorflow:global_step/sec: 126.399\n",
      "INFO:tensorflow:loss = 0.0, step = 1401 (0.791 sec)\n",
      "INFO:tensorflow:global_step/sec: 121.206\n",
      "INFO:tensorflow:loss = 0.0, step = 1501 (0.825 sec)\n",
      "INFO:tensorflow:global_step/sec: 123.167\n",
      "INFO:tensorflow:loss = 0.0, step = 1601 (0.812 sec)\n",
      "INFO:tensorflow:global_step/sec: 120.651\n",
      "INFO:tensorflow:loss = 0.0, step = 1701 (0.829 sec)\n",
      "INFO:tensorflow:global_step/sec: 117.439\n",
      "INFO:tensorflow:loss = 0.0, step = 1801 (0.851 sec)\n",
      "INFO:tensorflow:global_step/sec: 122.893\n",
      "INFO:tensorflow:loss = 0.0, step = 1901 (0.814 sec)\n",
      "INFO:tensorflow:Saving checkpoints for 2000 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/losses/losses_impl.py:667: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Starting evaluation at 2019-07-12T20:38:10Z\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2000\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Finished evaluation at 2019-07-12-20:38:12\n",
      "INFO:tensorflow:Saving dict for global step 2000: global_step = 2000, loss = 0.6683831, mae = 0.6548333, rmse = 0.817547\n",
      "INFO:tensorflow:Saving 'checkpoint_path' summary for global step 2000: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2000\n",
      "INFO:tensorflow:Loss for final step: 0.0.\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "rm -rf trained_model/pca_labeled\n",
    "export PYTHONPATH=$PYTHONPATH:$PWD/anomaly_detection_module\n",
    "python3 -m trainer.task \\\n",
    "  --train_file_pattern=$TRAIN_FILE_PATTERN \\\n",
    "  --eval_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --output_dir=$PWD/trained_model/pca_labeled \\\n",
    "  --job-dir=./tmp \\\n",
    "  --seq_len=$SEQ_LEN \\\n",
    "  --num_feat=$NUM_FEAT \\\n",
    "  --feat_names=$FEAT_NAMES \\\n",
    "  --feat_defaults=$FEAT_DEFAULTS \\\n",
    "  --train_batch_size=32 \\\n",
    "  --eval_batch_size=32 \\\n",
    "  --previous_train_steps=$PREVIOUS_TRAIN_STEPS \\\n",
    "  --reconstruction_epochs=1.0 \\\n",
    "  --train_examples=$TRAIN_EXAMPLES \\\n",
    "  --eval_examples=6400 \\\n",
    "  --start_delay_secs=$START_DELAY_SECS \\\n",
    "  --throttle_secs=$THROTTLE_SECS \\\n",
    "  --model_type=\"pca\" \\\n",
    "  --training_mode=$TRAINING_MODE \\\n",
    "  --autotune_principal_components=\"False\" \\\n",
    "  --labeled_tune_thresh=$LABELED_TUNE_THRESH \\\n",
    "  --num_time_anom_thresh=$NUM_TIME_ANOM_THRESH \\\n",
    "  --num_feat_anom_thresh=$NUM_FEAT_ANOM_THRESH"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Autotune principal components"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "train\n",
      "anomaly_detection: params = \n",
      "{'enc_dnn_hidden_units': [1024, 256, 64], 'eval_examples': 6400, 'num_time_anom_thresh': 300, 'latent_vector_size': 8, 'max_feat_anom_thresh': 2000.0, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'model_type': 'pca', 'train_examples': 6400, 'reverse_labels_sequence': True, 'training_mode': 'reconstruction', 'eval_batch_size': 32, 'dnn_hidden_units': [1024, 256, 64], 'time_thresh_scl': 2.0, 'time_loss_weight': 1.0, 'dec_dnn_hidden_units': [64, 256, 1024], 'min_time_anom_thresh': 100.0, 'eps': 1e-12, 'labeled_tune_thresh': True, 'start_delay_secs': 60, 'autotune_principal_components': False, 'num_feat': 5, 'train_batch_size': 32, 'feat_anom_thresh': None, 'feat_thresh_scl': 2.0, 'throttle_secs': 120, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', 'learning_rate': 0.1, 'dec_lstm_hidden_units': [16, 32, 64], 'feat_loss_weight': 1.0, 'k_principal_components_time': None, 'k_principal_components_feat': None, 'seq_len': 30, 'min_feat_anom_thresh': 100.0, 'train_file_pattern': 'data/val_norm_1_seq.csv', 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'num_feat_anom_thresh': 300, 'max_time_anom_thresh': 2000.0, 'time_anom_thresh': None, 'enc_lstm_hidden_units': [64, 32, 16], 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'f_score_beta': 0.05, 'reconstruction_epochs': 1.0, 'previous_train_steps': 2000}\n",
      "\n",
      "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
      "For more information, please see:\n",
      "  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
      "  * https://github.com/tensorflow/addons\n",
      "If you depend on functionality not listed there, please file an issue.\n",
      "\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "eval\n",
      "anomaly_detection: params = \n",
      "{'enc_dnn_hidden_units': [1024, 256, 64], 'eval_examples': 6400, 'num_time_anom_thresh': 300, 'latent_vector_size': 8, 'max_feat_anom_thresh': 2000.0, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'model_type': 'pca', 'train_examples': 6400, 'reverse_labels_sequence': True, 'training_mode': 'reconstruction', 'eval_batch_size': 32, 'dnn_hidden_units': [1024, 256, 64], 'time_thresh_scl': 2.0, 'time_loss_weight': 1.0, 'dec_dnn_hidden_units': [64, 256, 1024], 'min_time_anom_thresh': 100.0, 'eps': 1e-12, 'labeled_tune_thresh': True, 'start_delay_secs': 60, 'autotune_principal_components': False, 'num_feat': 5, 'train_batch_size': 32, 'feat_anom_thresh': None, 'feat_thresh_scl': 2.0, 'throttle_secs': 120, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', 'learning_rate': 0.1, 'dec_lstm_hidden_units': [16, 32, 64], 'feat_loss_weight': 1.0, 'k_principal_components_time': None, 'k_principal_components_feat': None, 'seq_len': 30, 'min_feat_anom_thresh': 100.0, 'train_file_pattern': 'data/val_norm_1_seq.csv', 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'num_feat_anom_thresh': 300, 'max_time_anom_thresh': 2000.0, 'time_anom_thresh': None, 'enc_lstm_hidden_units': [64, 32, 16], 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'f_score_beta': 0.05, 'reconstruction_epochs': 1.0, 'previous_train_steps': 2000}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using default config.\n",
      "INFO:tensorflow:Using config: {'_save_checkpoints_secs': 600, '_task_id': 0, '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_is_chief': True, '_master': '', '_device_fn': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7fdc5760b400>, '_train_distribute': None, '_evaluation_master': '', '_tf_random_seed': None, '_service': None, '_save_checkpoints_steps': None, '_num_worker_replicas': 1, '_keep_checkpoint_every_n_hours': 10000, '_eval_distribute': None, '_log_step_count_steps': 100, '_experimental_distribute': None, '_global_id_in_cluster': 0, '_save_summary_steps': 100, '_protocol': None, '_num_ps_replicas': 0, '_model_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', '_task_type': 'worker', '_keep_checkpoint_max': 5}\n",
      "INFO:tensorflow:Not using Distribute Coordinator.\n",
      "INFO:tensorflow:Running training and evaluation locally (non-distributed).\n",
      "INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after every checkpoint. Checkpoint frequency is determined based on RunConfig arguments: save_checkpoints_steps None or save_checkpoints_secs 600.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Create CheckpointSaverHook.\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "2019-07-12 20:38:16.812687: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
      "2019-07-12 20:38:16.819242: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:38:16.820461: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x56367caa2d30 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:38:16.820498: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2000\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1070: get_checkpoint_mtimes (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file utilities to get mtimes.\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Saving checkpoints for 2000 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt.\n",
      "INFO:tensorflow:loss = 0.0, step = 2001\n",
      "INFO:tensorflow:global_step/sec: 99.306\n",
      "INFO:tensorflow:loss = 0.0, step = 2101 (1.007 sec)\n",
      "INFO:tensorflow:Saving checkpoints for 2200 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/losses/losses_impl.py:667: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Starting evaluation at 2019-07-12T20:38:19Z\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2200\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Finished evaluation at 2019-07-12-20:38:21\n",
      "INFO:tensorflow:Saving dict for global step 2200: global_step = 2200, loss = 0.6683827, mae = 0.65482765, rmse = 0.8175468\n",
      "INFO:tensorflow:Saving 'checkpoint_path' summary for global step 2200: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2200\n",
      "INFO:tensorflow:Loss for final step: 0.0.\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "export PYTHONPATH=$PYTHONPATH:$PWD/anomaly_detection_module\n",
    "python3 -m trainer.task \\\n",
    "  --train_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --eval_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --output_dir=$PWD/trained_model/pca_labeled \\\n",
    "  --job-dir=./tmp \\\n",
    "  --seq_len=$SEQ_LEN \\\n",
    "  --num_feat=$NUM_FEAT \\\n",
    "  --feat_names=$FEAT_NAMES \\\n",
    "  --feat_defaults=$FEAT_DEFAULTS \\\n",
    "  --train_batch_size=32 \\\n",
    "  --eval_batch_size=32 \\\n",
    "  --previous_train_steps=2000 \\\n",
    "  --reconstruction_epochs=1.0 \\\n",
    "  --train_examples=6400 \\\n",
    "  --eval_examples=6400 \\\n",
    "  --start_delay_secs=$START_DELAY_SECS \\\n",
    "  --throttle_secs=$THROTTLE_SECS \\\n",
    "  --model_type=\"pca\" \\\n",
    "  --training_mode=$TRAINING_MODE \\\n",
    "  --autotune_principal_components=\"True\" \\\n",
    "  --labeled_tune_thresh=$LABELED_TUNE_THRESH \\\n",
    "  --num_time_anom_thresh=$NUM_TIME_ANOM_THRESH \\\n",
    "  --num_feat_anom_thresh=$NUM_FEAT_ANOM_THRESH"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Train error distribution statistics variables"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Import os environment variables for error dist training hyperparameters\n",
    "os.environ[\"TRAIN_FILE_PATTERN\"] = \"data/val_norm_1_seq.csv\"\n",
    "os.environ[\"EVAL_FILE_PATTERN\"] = \"data/val_norm_1_seq.csv\"\n",
    "os.environ[\"PREVIOUS_TRAIN_STEPS\"] = str(2000)\n",
    "os.environ[\"TRAIN_EXAMPLES\"] = str(6400)\n",
    "os.environ[\"TRAINING_MODE\"] = \"calculate_error_distribution_statistics\"\n",
    "os.environ[\"EPS\"] = \"1e-12\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Dense Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "train\n",
      "anomaly_detection: params = \n",
      "{'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/', 'seq_len': 30, 'dec_lstm_hidden_units': [16, 32, 64], 'f_score_beta': 0.05, 'labeled_tune_thresh': True, 'previous_train_steps': 2000, 'latent_vector_size': 8, 'max_time_anom_thresh': 2000.0, 'time_loss_weight': 1.0, 'reconstruction_epochs': 1.0, 'training_mode': 'calculate_error_distribution_statistics', 'enc_dnn_hidden_units': [64, 32, 16], 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'min_feat_anom_thresh': 100.0, 'num_time_anom_thresh': 300, 'start_delay_secs': 60, 'num_feat_anom_thresh': 300, 'time_thresh_scl': 2.0, 'max_feat_anom_thresh': 2000.0, 'train_batch_size': 32, 'enc_lstm_hidden_units': [64, 32, 16], 'train_file_pattern': 'data/val_norm_1_seq.csv', 'reverse_labels_sequence': True, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'dec_dnn_hidden_units': [16, 32, 64], 'min_time_anom_thresh': 100.0, 'model_type': 'dense_autoencoder', 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'throttle_secs': 120, 'k_principal_components_feat': None, 'autotune_principal_components': False, 'dnn_hidden_units': [1024, 256, 64], 'time_anom_thresh': None, 'eval_examples': 1024, 'k_principal_components_time': None, 'feat_loss_weight': 1.0, 'train_examples': 6400, 'eval_batch_size': 32, 'feat_anom_thresh': None, 'num_feat': 5, 'learning_rate': 0.1, 'eps': 1e-12, 'feat_thresh_scl': 2.0}\n",
      "\n",
      "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
      "For more information, please see:\n",
      "  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
      "  * https://github.com/tensorflow/addons\n",
      "If you depend on functionality not listed there, please file an issue.\n",
      "\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "eval\n",
      "anomaly_detection: params = \n",
      "{'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/', 'seq_len': 30, 'dec_lstm_hidden_units': [16, 32, 64], 'f_score_beta': 0.05, 'labeled_tune_thresh': True, 'previous_train_steps': 2000, 'latent_vector_size': 8, 'max_time_anom_thresh': 2000.0, 'time_loss_weight': 1.0, 'reconstruction_epochs': 1.0, 'training_mode': 'calculate_error_distribution_statistics', 'enc_dnn_hidden_units': [64, 32, 16], 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'min_feat_anom_thresh': 100.0, 'num_time_anom_thresh': 300, 'start_delay_secs': 60, 'num_feat_anom_thresh': 300, 'time_thresh_scl': 2.0, 'max_feat_anom_thresh': 2000.0, 'train_batch_size': 32, 'enc_lstm_hidden_units': [64, 32, 16], 'train_file_pattern': 'data/val_norm_1_seq.csv', 'reverse_labels_sequence': True, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'dec_dnn_hidden_units': [16, 32, 64], 'min_time_anom_thresh': 100.0, 'model_type': 'dense_autoencoder', 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'throttle_secs': 120, 'k_principal_components_feat': None, 'autotune_principal_components': False, 'dnn_hidden_units': [1024, 256, 64], 'time_anom_thresh': None, 'eval_examples': 1024, 'k_principal_components_time': None, 'feat_loss_weight': 1.0, 'train_examples': 6400, 'eval_batch_size': 32, 'feat_anom_thresh': None, 'num_feat': 5, 'learning_rate': 0.1, 'eps': 1e-12, 'feat_thresh_scl': 2.0}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using default config.\n",
      "INFO:tensorflow:Using config: {'_num_worker_replicas': 1, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7fca79a60470>, '_num_ps_replicas': 0, '_save_checkpoints_secs': 600, '_is_chief': True, '_log_step_count_steps': 100, '_experimental_distribute': None, '_master': '', '_task_id': 0, '_protocol': None, '_save_summary_steps': 100, '_tf_random_seed': None, '_keep_checkpoint_every_n_hours': 10000, '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_save_checkpoints_steps': None, '_train_distribute': None, '_service': None, '_task_type': 'worker', '_eval_distribute': None, '_global_id_in_cluster': 0, '_model_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/', '_keep_checkpoint_max': 5, '_evaluation_master': '', '_device_fn': None}\n",
      "INFO:tensorflow:Not using Distribute Coordinator.\n",
      "INFO:tensorflow:Running training and evaluation locally (non-distributed).\n",
      "INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after every checkpoint. Checkpoint frequency is determined based on RunConfig arguments: save_checkpoints_steps None or save_checkpoints_secs 600.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_dense.py:27: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use keras.layers.dense instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Create CheckpointSaverHook.\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "2019-07-12 20:39:06.320824: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
      "2019-07-12 20:39:06.327518: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:39:06.329056: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x562c4fe4c470 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:39:06.329100: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt-2000\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1070: get_checkpoint_mtimes (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file utilities to get mtimes.\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Saving checkpoints for 2000 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt.\n",
      "INFO:tensorflow:loss = 0.0, step = 2001\n",
      "INFO:tensorflow:global_step/sec: 104.179\n",
      "INFO:tensorflow:loss = 0.0, step = 2101 (0.960 sec)\n",
      "INFO:tensorflow:Saving checkpoints for 2200 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/losses/losses_impl.py:667: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Starting evaluation at 2019-07-12T20:39:09Z\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt-2200\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Finished evaluation at 2019-07-12-20:39:11\n",
      "INFO:tensorflow:Saving dict for global step 2200: global_step = 2200, loss = 1.3207021\n",
      "INFO:tensorflow:Saving 'checkpoint_path' summary for global step 2200: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt-2200\n",
      "INFO:tensorflow:Loss for final step: 0.0.\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "export PYTHONPATH=$PYTHONPATH:$PWD/anomaly_detection_module\n",
    "python3 -m trainer.task \\\n",
    "  --train_file_pattern=$TRAIN_FILE_PATTERN \\\n",
    "  --eval_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --output_dir=$PWD/trained_model/dense_labeled \\\n",
    "  --job-dir=./tmp \\\n",
    "  --seq_len=$SEQ_LEN \\\n",
    "  --num_feat=$NUM_FEAT \\\n",
    "  --feat_names=$FEAT_NAMES \\\n",
    "  --feat_defaults=$FEAT_DEFAULTS \\\n",
    "  --train_batch_size=32 \\\n",
    "  --eval_batch_size=32 \\\n",
    "  --previous_train_steps=$PREVIOUS_TRAIN_STEPS \\\n",
    "  --train_examples=$TRAIN_EXAMPLES \\\n",
    "  --start_delay_secs=$START_DELAY_SECS \\\n",
    "  --throttle_secs=$THROTTLE_SECS \\\n",
    "  --model_type=\"dense_autoencoder\" \\\n",
    "  --enc_dnn_hidden_units=$ENC_DNN_HIDDEN_UNITS \\\n",
    "  --latent_vector_size=$LATENT_VECTOR_SIZE \\\n",
    "  --dec_dnn_hidden_units=$DEC_DNN_HIDDEN_UNITS \\\n",
    "  --time_loss_weight=$TIME_LOSS_WEIGHT \\\n",
    "  --feat_loss_weight=$FEAT_LOSS_WEIGHT \\\n",
    "  --training_mode=$TRAINING_MODE \\\n",
    "  --labeled_tune_thresh=$LABELED_TUNE_THRESH \\\n",
    "  --eps=$EPS \\\n",
    "  --num_time_anom_thresh=$NUM_TIME_ANOM_THRESH \\\n",
    "  --num_feat_anom_thresh=$NUM_FEAT_ANOM_THRESH"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### LSTM Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "train\n",
      "anomaly_detection: params = \n",
      "{'throttle_secs': 120, 'time_anom_thresh': None, 'autotune_principal_components': False, 'previous_train_steps': 2000, 'learning_rate': 0.1, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'start_delay_secs': 60, 'enc_dnn_hidden_units': [1024, 256, 64], 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'time_loss_weight': 1.0, 'num_feat': 5, 'train_examples': 6400, 'num_feat_anom_thresh': 300, 'feat_anom_thresh': None, 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'model_type': 'lstm_enc_dec_autoencoder', 'eval_batch_size': 32, 'train_file_pattern': 'data/val_norm_1_seq.csv', 'training_mode': 'calculate_error_distribution_statistics', 'reverse_labels_sequence': True, 'dec_dnn_hidden_units': [64, 256, 1024], 'feat_thresh_scl': 2.0, 'time_thresh_scl': 2.0, 'max_time_anom_thresh': 2000.0, 'labeled_tune_thresh': True, 'enc_lstm_hidden_units': [64, 32, 16], 'reconstruction_epochs': 1.0, 'dec_lstm_hidden_units': [16, 32, 64], 'lstm_dropout_output_keep_probs': [0.9, 0.95, 1.0], 'feat_loss_weight': 1.0, 'min_feat_anom_thresh': 100.0, 'k_principal_components_feat': None, 'max_feat_anom_thresh': 2000.0, 'dnn_hidden_units': [1024, 256, 64], 'min_time_anom_thresh': 100.0, 'k_principal_components_time': None, 'latent_vector_size': 8, 'eval_examples': 1024, 'f_score_beta': 0.05, 'train_batch_size': 32, 'seq_len': 30, 'eps': 1e-12, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/', 'num_time_anom_thresh': 300}\n",
      "\n",
      "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
      "For more information, please see:\n",
      "  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
      "  * https://github.com/tensorflow/addons\n",
      "If you depend on functionality not listed there, please file an issue.\n",
      "\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "eval\n",
      "anomaly_detection: params = \n",
      "{'throttle_secs': 120, 'time_anom_thresh': None, 'autotune_principal_components': False, 'previous_train_steps': 2000, 'learning_rate': 0.1, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'start_delay_secs': 60, 'enc_dnn_hidden_units': [1024, 256, 64], 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'time_loss_weight': 1.0, 'num_feat': 5, 'train_examples': 6400, 'num_feat_anom_thresh': 300, 'feat_anom_thresh': None, 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'model_type': 'lstm_enc_dec_autoencoder', 'eval_batch_size': 32, 'train_file_pattern': 'data/val_norm_1_seq.csv', 'training_mode': 'calculate_error_distribution_statistics', 'reverse_labels_sequence': True, 'dec_dnn_hidden_units': [64, 256, 1024], 'feat_thresh_scl': 2.0, 'time_thresh_scl': 2.0, 'max_time_anom_thresh': 2000.0, 'labeled_tune_thresh': True, 'enc_lstm_hidden_units': [64, 32, 16], 'reconstruction_epochs': 1.0, 'dec_lstm_hidden_units': [16, 32, 64], 'lstm_dropout_output_keep_probs': [0.9, 0.95, 1.0], 'feat_loss_weight': 1.0, 'min_feat_anom_thresh': 100.0, 'k_principal_components_feat': None, 'max_feat_anom_thresh': 2000.0, 'dnn_hidden_units': [1024, 256, 64], 'min_time_anom_thresh': 100.0, 'k_principal_components_time': None, 'latent_vector_size': 8, 'eval_examples': 1024, 'f_score_beta': 0.05, 'train_batch_size': 32, 'seq_len': 30, 'eps': 1e-12, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/', 'num_time_anom_thresh': 300}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using default config.\n",
      "INFO:tensorflow:Using config: {'_master': '', '_num_worker_replicas': 1, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7feff0fd64a8>, '_save_summary_steps': 100, '_task_id': 0, '_train_distribute': None, '_eval_distribute': None, '_protocol': None, '_tf_random_seed': None, '_global_id_in_cluster': 0, '_is_chief': True, '_experimental_distribute': None, '_num_ps_replicas': 0, '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_device_fn': None, '_model_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/', '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': 100, '_save_checkpoints_steps': None, '_service': None, '_evaluation_master': '', '_save_checkpoints_secs': 600, '_task_type': 'worker'}\n",
      "INFO:tensorflow:Not using Distribute Coordinator.\n",
      "INFO:tensorflow:Running training and evaluation locally (non-distributed).\n",
      "INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after every checkpoint. Checkpoint frequency is determined based on RunConfig arguments: save_checkpoints_steps None or save_checkpoints_secs 600.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:26: BasicLSTMCell.__init__ (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This class is equivalent as tf.keras.layers.LSTMCell, and will be replaced by that in Tensorflow 2.0.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:41: MultiRNNCell.__init__ (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This class is equivalent as tf.keras.layers.StackedRNNCells, and will be replaced by that in Tensorflow 2.0.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:207: static_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Please use `keras.layers.RNN(cell, unroll=True)`, which is equivalent to this API\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py:1259: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:225: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use keras.layers.dense instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Create CheckpointSaverHook.\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "2019-07-12 20:39:20.879493: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
      "2019-07-12 20:39:20.886590: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:39:20.887949: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x564a45e61f70 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:39:20.887997: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt-2000\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1070: get_checkpoint_mtimes (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file utilities to get mtimes.\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Saving checkpoints for 2000 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt.\n",
      "INFO:tensorflow:loss = 0.0, step = 2001\n",
      "INFO:tensorflow:global_step/sec: 9.24818\n",
      "INFO:tensorflow:loss = 0.0, step = 2101 (10.813 sec)\n",
      "INFO:tensorflow:Saving checkpoints for 2200 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/losses/losses_impl.py:667: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Starting evaluation at 2019-07-12T20:39:49Z\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt-2200\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Finished evaluation at 2019-07-12-20:40:08\n",
      "INFO:tensorflow:Saving dict for global step 2200: global_step = 2200, loss = 1.1017623\n",
      "INFO:tensorflow:Saving 'checkpoint_path' summary for global step 2200: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt-2200\n",
      "INFO:tensorflow:Loss for final step: 0.0.\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "export PYTHONPATH=$PYTHONPATH:$PWD/anomaly_detection_module\n",
    "python3 -m trainer.task \\\n",
    "  --train_file_pattern=$TRAIN_FILE_PATTERN \\\n",
    "  --eval_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --output_dir=$PWD/trained_model/lstm_labeled \\\n",
    "  --job-dir=./tmp \\\n",
    "  --seq_len=$SEQ_LEN \\\n",
    "  --num_feat=$NUM_FEAT \\\n",
    "  --feat_names=$FEAT_NAMES \\\n",
    "  --feat_defaults=$FEAT_DEFAULTS \\\n",
    "  --train_batch_size=32 \\\n",
    "  --eval_batch_size=32 \\\n",
    "  --previous_train_steps=$PREVIOUS_TRAIN_STEPS \\\n",
    "  --train_examples=$TRAIN_EXAMPLES \\\n",
    "  --start_delay_secs=$START_DELAY_SECS \\\n",
    "  --throttle_secs=$THROTTLE_SECS \\\n",
    "  --model_type=\"lstm_enc_dec_autoencoder\" \\\n",
    "  --reverse_labels_sequence=$REVERSE_LABELS_SEQUENCE \\\n",
    "  --enc_lstm_hidden_units=$ENC_LSTM_HIDDEN_UNITS \\\n",
    "  --dec_lstm_hidden_units=$DEC_LSTM_HIDDEN_UNITS \\\n",
    "  --lstm_dropout_output_keep_probs=$LSTM_DROPOUT_OUTPUT_KEEP_PROBS \\\n",
    "  --dnn_hidden_units=$DNN_HIDDEN_UNITS \\\n",
    "  --training_mode=$TRAINING_MODE \\\n",
    "  --labeled_tune_thresh=$LABELED_TUNE_THRESH \\\n",
    "  --eps=$EPS \\\n",
    "  --num_time_anom_thresh=$NUM_TIME_ANOM_THRESH \\\n",
    "  --num_feat_anom_thresh=$NUM_FEAT_ANOM_THRESH"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### PCA Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "train\n",
      "anomaly_detection: params = \n",
      "{'labeled_tune_thresh': True, 'seq_len': 30, 'dec_dnn_hidden_units': [64, 256, 1024], 'model_type': 'pca', 'num_time_anom_thresh': 300, 'throttle_secs': 120, 'eval_examples': 1024, 'time_anom_thresh': None, 'feat_anom_thresh': None, 'k_principal_components_time': None, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'k_principal_components_feat': None, 'max_feat_anom_thresh': 2000.0, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'feat_thresh_scl': 2.0, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', 'autotune_principal_components': False, 'enc_lstm_hidden_units': [64, 32, 16], 'train_examples': 6400, 'max_time_anom_thresh': 2000.0, 'training_mode': 'calculate_error_distribution_statistics', 'min_feat_anom_thresh': 100.0, 'dnn_hidden_units': [1024, 256, 64], 'train_file_pattern': 'data/val_norm_1_seq.csv', 'learning_rate': 0.1, 'latent_vector_size': 8, 'previous_train_steps': 2200, 'feat_loss_weight': 1.0, 'train_batch_size': 32, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'reverse_labels_sequence': True, 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'time_thresh_scl': 2.0, 'eval_batch_size': 32, 'time_loss_weight': 1.0, 'f_score_beta': 0.05, 'num_feat': 5, 'reconstruction_epochs': 1.0, 'start_delay_secs': 60, 'num_feat_anom_thresh': 300, 'min_time_anom_thresh': 100.0, 'enc_dnn_hidden_units': [1024, 256, 64], 'dec_lstm_hidden_units': [16, 32, 64], 'eps': 1e-12}\n",
      "\n",
      "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
      "For more information, please see:\n",
      "  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
      "  * https://github.com/tensorflow/addons\n",
      "If you depend on functionality not listed there, please file an issue.\n",
      "\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "eval\n",
      "anomaly_detection: params = \n",
      "{'labeled_tune_thresh': True, 'seq_len': 30, 'dec_dnn_hidden_units': [64, 256, 1024], 'model_type': 'pca', 'num_time_anom_thresh': 300, 'throttle_secs': 120, 'eval_examples': 1024, 'time_anom_thresh': None, 'feat_anom_thresh': None, 'k_principal_components_time': None, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'k_principal_components_feat': None, 'max_feat_anom_thresh': 2000.0, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'feat_thresh_scl': 2.0, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', 'autotune_principal_components': False, 'enc_lstm_hidden_units': [64, 32, 16], 'train_examples': 6400, 'max_time_anom_thresh': 2000.0, 'training_mode': 'calculate_error_distribution_statistics', 'min_feat_anom_thresh': 100.0, 'dnn_hidden_units': [1024, 256, 64], 'train_file_pattern': 'data/val_norm_1_seq.csv', 'learning_rate': 0.1, 'latent_vector_size': 8, 'previous_train_steps': 2200, 'feat_loss_weight': 1.0, 'train_batch_size': 32, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'reverse_labels_sequence': True, 'eval_file_pattern': 'data/val_norm_1_seq.csv', 'time_thresh_scl': 2.0, 'eval_batch_size': 32, 'time_loss_weight': 1.0, 'f_score_beta': 0.05, 'num_feat': 5, 'reconstruction_epochs': 1.0, 'start_delay_secs': 60, 'num_feat_anom_thresh': 300, 'min_time_anom_thresh': 100.0, 'enc_dnn_hidden_units': [1024, 256, 64], 'dec_lstm_hidden_units': [16, 32, 64], 'eps': 1e-12}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using default config.\n",
      "INFO:tensorflow:Using config: {'_num_worker_replicas': 1, '_experimental_distribute': None, '_task_type': 'worker', '_task_id': 0, '_model_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_service': None, '_save_summary_steps': 100, '_evaluation_master': '', '_keep_checkpoint_every_n_hours': 10000, '_device_fn': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f248a023400>, '_protocol': None, '_global_id_in_cluster': 0, '_is_chief': True, '_num_ps_replicas': 0, '_save_checkpoints_steps': None, '_eval_distribute': None, '_save_checkpoints_secs': 600, '_tf_random_seed': None, '_master': '', '_log_step_count_steps': 100, '_keep_checkpoint_max': 5, '_train_distribute': None}\n",
      "INFO:tensorflow:Not using Distribute Coordinator.\n",
      "INFO:tensorflow:Running training and evaluation locally (non-distributed).\n",
      "INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after every checkpoint. Checkpoint frequency is determined based on RunConfig arguments: save_checkpoints_steps None or save_checkpoints_secs 600.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Create CheckpointSaverHook.\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "2019-07-12 20:40:14.021286: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
      "2019-07-12 20:40:14.026910: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:40:14.027762: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x55cef5db09d0 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:40:14.027788: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2200\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1070: get_checkpoint_mtimes (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file utilities to get mtimes.\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Saving checkpoints for 2200 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt.\n",
      "INFO:tensorflow:loss = 0.0, step = 2201\n",
      "INFO:tensorflow:global_step/sec: 160.731\n",
      "INFO:tensorflow:loss = 0.0, step = 2301 (0.622 sec)\n",
      "INFO:tensorflow:Saving checkpoints for 2400 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/losses/losses_impl.py:667: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Starting evaluation at 2019-07-12T20:40:16Z\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2400\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Finished evaluation at 2019-07-12-20:40:17\n",
      "INFO:tensorflow:Saving dict for global step 2400: global_step = 2400, loss = 0.6683827\n",
      "INFO:tensorflow:Saving 'checkpoint_path' summary for global step 2400: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2400\n",
      "INFO:tensorflow:Loss for final step: 0.0.\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "export PYTHONPATH=$PYTHONPATH:$PWD/anomaly_detection_module\n",
    "python3 -m trainer.task \\\n",
    "  --train_file_pattern=$TRAIN_FILE_PATTERN \\\n",
    "  --eval_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --output_dir=$PWD/trained_model/pca_labeled \\\n",
    "  --job-dir=./tmp \\\n",
    "  --seq_len=$SEQ_LEN \\\n",
    "  --num_feat=$NUM_FEAT \\\n",
    "  --feat_names=$FEAT_NAMES \\\n",
    "  --feat_defaults=$FEAT_DEFAULTS \\\n",
    "  --train_batch_size=32 \\\n",
    "  --eval_batch_size=32 \\\n",
    "  --previous_train_steps=2200 \\\n",
    "  --train_examples=$TRAIN_EXAMPLES \\\n",
    "  --start_delay_secs=$START_DELAY_SECS \\\n",
    "  --throttle_secs=$THROTTLE_SECS \\\n",
    "  --model_type=\"pca\" \\\n",
    "  --training_mode=$TRAINING_MODE \\\n",
    "  --labeled_tune_thresh=$LABELED_TUNE_THRESH \\\n",
    "  --eps=$EPS \\\n",
    "  --num_time_anom_thresh=$NUM_TIME_ANOM_THRESH \\\n",
    "  --num_feat_anom_thresh=$NUM_FEAT_ANOM_THRESH"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Tune anomaly thresholds"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Import os environment variables for tune threshold training hyperparameters\n",
    "os.environ[\"PREVIOUS_TRAIN_STEPS\"] = str(2200)\n",
    "os.environ[\"TRAIN_EXAMPLES\"] = str(12800)\n",
    "os.environ[\"TRAINING_MODE\"] = \"tune_anomaly_thresholds\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Labeled"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Import os environment variables for labeled tune threshold training hyperparameters\n",
    "os.environ[\"TRAIN_FILE_PATTERN\"] = \"data/labeled_val_mixed_seq.csv\"\n",
    "os.environ[\"EVAL_FILE_PATTERN\"] = \"data/labeled_val_mixed_seq.csv\"\n",
    "os.environ[\"MIN_TIME_ANOM_THRESH\"] = str(1.0)\n",
    "os.environ[\"MAX_TIME_ANOM_THRESH\"] = str(20.0)\n",
    "os.environ[\"MIN_FEAT_ANOM_THRESH\"] = str(20.0)\n",
    "os.environ[\"MAX_FEAT_ANOM_THRESH\"] = str(80.0)\n",
    "os.environ[\"F_SCORE_BETA\"] = str(0.05)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Dense Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "Tensor(\"IteratorGetNext:5\", shape=(?,), dtype=float64, device=/device:CPU:0)\n",
      "anomaly_detection: mode = \n",
      "train\n",
      "anomaly_detection: params = \n",
      "{'time_loss_weight': 1.0, 'dec_lstm_hidden_units': [16, 32, 64], 'reverse_labels_sequence': True, 'feat_anom_thresh': None, 'start_delay_secs': 60, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/', 'min_time_anom_thresh': 1.0, 'train_file_pattern': 'data/labeled_val_mixed_seq.csv', 'training_mode': 'tune_anomaly_thresholds', 'train_batch_size': 32, 'f_score_beta': 0.05, 'model_type': 'dense_autoencoder', 'throttle_secs': 120, 'eps': 1e-12, 'dnn_hidden_units': [1024, 256, 64], 'seq_len': 30, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'feat_thresh_scl': 2.0, 'autotune_principal_components': False, 'enc_lstm_hidden_units': [64, 32, 16], 'labeled_tune_thresh': True, 'reconstruction_epochs': 1.0, 'time_thresh_scl': 2.0, 'eval_examples': 1024, 'eval_file_pattern': 'data/labeled_val_mixed_seq.csv', 'num_feat_anom_thresh': 300, 'max_feat_anom_thresh': 80.0, 'previous_train_steps': 2200, 'num_feat': 5, 'k_principal_components_feat': None, 'enc_dnn_hidden_units': [64, 32, 16], 'k_principal_components_time': None, 'min_feat_anom_thresh': 20.0, 'latent_vector_size': 8, 'feat_loss_weight': 1.0, 'eval_batch_size': 32, 'time_anom_thresh': None, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'learning_rate': 0.1, 'max_time_anom_thresh': 20.0, 'num_time_anom_thresh': 300, 'train_examples': 12800, 'dec_dnn_hidden_units': [16, 32, 64], 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']]}\n",
      "\n",
      "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
      "For more information, please see:\n",
      "  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
      "  * https://github.com/tensorflow/addons\n",
      "If you depend on functionality not listed there, please file an issue.\n",
      "\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "Tensor(\"IteratorGetNext:5\", shape=(?,), dtype=float64, device=/device:CPU:0)\n",
      "anomaly_detection: mode = \n",
      "eval\n",
      "anomaly_detection: params = \n",
      "{'time_loss_weight': 1.0, 'dec_lstm_hidden_units': [16, 32, 64], 'reverse_labels_sequence': True, 'feat_anom_thresh': None, 'start_delay_secs': 60, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/', 'min_time_anom_thresh': 1.0, 'train_file_pattern': 'data/labeled_val_mixed_seq.csv', 'training_mode': 'tune_anomaly_thresholds', 'train_batch_size': 32, 'f_score_beta': 0.05, 'model_type': 'dense_autoencoder', 'throttle_secs': 120, 'eps': 1e-12, 'dnn_hidden_units': [1024, 256, 64], 'seq_len': 30, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'feat_thresh_scl': 2.0, 'autotune_principal_components': False, 'enc_lstm_hidden_units': [64, 32, 16], 'labeled_tune_thresh': True, 'reconstruction_epochs': 1.0, 'time_thresh_scl': 2.0, 'eval_examples': 1024, 'eval_file_pattern': 'data/labeled_val_mixed_seq.csv', 'num_feat_anom_thresh': 300, 'max_feat_anom_thresh': 80.0, 'previous_train_steps': 2200, 'num_feat': 5, 'k_principal_components_feat': None, 'enc_dnn_hidden_units': [64, 32, 16], 'k_principal_components_time': None, 'min_feat_anom_thresh': 20.0, 'latent_vector_size': 8, 'feat_loss_weight': 1.0, 'eval_batch_size': 32, 'time_anom_thresh': None, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'learning_rate': 0.1, 'max_time_anom_thresh': 20.0, 'num_time_anom_thresh': 300, 'train_examples': 12800, 'dec_dnn_hidden_units': [16, 32, 64], 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']]}\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_2': <tf.Tensor 'StringToNumber:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'StringToNumber_1:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'StringToNumber_2:0' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'StringToNumber_3:0' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'StringToNumber_4:0' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "infer\n",
      "anomaly_detection: params = \n",
      "{'time_loss_weight': 1.0, 'dec_lstm_hidden_units': [16, 32, 64], 'reverse_labels_sequence': True, 'feat_anom_thresh': None, 'start_delay_secs': 60, 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/', 'min_time_anom_thresh': 1.0, 'train_file_pattern': 'data/labeled_val_mixed_seq.csv', 'training_mode': 'tune_anomaly_thresholds', 'train_batch_size': 32, 'f_score_beta': 0.05, 'model_type': 'dense_autoencoder', 'throttle_secs': 120, 'eps': 1e-12, 'dnn_hidden_units': [1024, 256, 64], 'seq_len': 30, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'feat_thresh_scl': 2.0, 'autotune_principal_components': False, 'enc_lstm_hidden_units': [64, 32, 16], 'labeled_tune_thresh': True, 'reconstruction_epochs': 1.0, 'time_thresh_scl': 2.0, 'eval_examples': 1024, 'eval_file_pattern': 'data/labeled_val_mixed_seq.csv', 'num_feat_anom_thresh': 300, 'max_feat_anom_thresh': 80.0, 'previous_train_steps': 2200, 'num_feat': 5, 'k_principal_components_feat': None, 'enc_dnn_hidden_units': [64, 32, 16], 'k_principal_components_time': None, 'min_feat_anom_thresh': 20.0, 'latent_vector_size': 8, 'feat_loss_weight': 1.0, 'eval_batch_size': 32, 'time_anom_thresh': None, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'learning_rate': 0.1, 'max_time_anom_thresh': 20.0, 'num_time_anom_thresh': 300, 'train_examples': 12800, 'dec_dnn_hidden_units': [16, 32, 64], 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']]}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using default config.\n",
      "INFO:tensorflow:Using config: {'_keep_checkpoint_every_n_hours': 10000, '_train_distribute': None, '_is_chief': True, '_task_id': 0, '_save_checkpoints_steps': None, '_save_checkpoints_secs': 600, '_save_summary_steps': 100, '_log_step_count_steps': 100, '_num_ps_replicas': 0, '_task_type': 'worker', '_tf_random_seed': None, '_global_id_in_cluster': 0, '_keep_checkpoint_max': 5, '_evaluation_master': '', '_num_worker_replicas': 1, '_eval_distribute': None, '_service': None, '_device_fn': None, '_master': '', '_model_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/', '_experimental_distribute': None, '_protocol': None, '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7fe977018588>}\n",
      "INFO:tensorflow:Not using Distribute Coordinator.\n",
      "INFO:tensorflow:Running training and evaluation locally (non-distributed).\n",
      "INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after every checkpoint. Checkpoint frequency is determined based on RunConfig arguments: save_checkpoints_steps None or save_checkpoints_secs 600.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_dense.py:27: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use keras.layers.dense instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Create CheckpointSaverHook.\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "2019-07-12 20:40:22.544499: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
      "2019-07-12 20:40:22.551685: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:40:22.552695: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x55e4f5e20ee0 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:40:22.552726: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt-2200\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1070: get_checkpoint_mtimes (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file utilities to get mtimes.\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Saving checkpoints for 2200 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt.\n",
      "INFO:tensorflow:loss = 0.0, step = 2201\n",
      "INFO:tensorflow:global_step/sec: 23.8677\n",
      "INFO:tensorflow:loss = 0.0, step = 2301 (4.190 sec)\n",
      "INFO:tensorflow:global_step/sec: 26.1906\n",
      "INFO:tensorflow:loss = 0.0, step = 2401 (3.818 sec)\n",
      "INFO:tensorflow:global_step/sec: 26.5703\n",
      "INFO:tensorflow:loss = 0.0, step = 2501 (3.763 sec)\n",
      "INFO:tensorflow:Saving checkpoints for 2600 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/metrics_impl.py:363: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "INFO:tensorflow:Starting evaluation at 2019-07-12T20:40:39Z\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt-2600\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Finished evaluation at 2019-07-12-20:40:42\n",
      "INFO:tensorflow:Saving dict for global step 2600: feat_anom_acc = 1.0, feat_anom_f_beta = 1.0, feat_anom_fn = 0, feat_anom_fp = 0, feat_anom_pre = 1.0, feat_anom_rec = 1.0, feat_anom_tn = 6400, feat_anom_tp = 6400, global_step = 2600, loss = 0.0, time_anom_acc = 1.0, time_anom_f_beta = 1.0, time_anom_fn = 0, time_anom_fp = 0, time_anom_pre = 1.0, time_anom_rec = 1.0, time_anom_tn = 6400, time_anom_tp = 6400\n",
      "INFO:tensorflow:Saving 'checkpoint_path' summary for global step 2600: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt-2600\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/saved_model/signature_def_utils_impl.py:205: build_tensor_info (from tensorflow.python.saved_model.utils_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.utils.build_tensor_info or tf.compat.v1.saved_model.build_tensor_info.\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Classify: None\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Predict: ['serving_default', 'predict_export_outputs']\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Train: None\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Regress: None\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Eval: None\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/model.ckpt-2600\n",
      "INFO:tensorflow:Assets added to graph.\n",
      "INFO:tensorflow:No assets to write.\n",
      "INFO:tensorflow:SavedModel written to: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/dense_labeled/export/exporter/temp-b'1562964043'/saved_model.pb\n",
      "INFO:tensorflow:Loss for final step: 0.0.\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "export PYTHONPATH=$PYTHONPATH:$PWD/anomaly_detection_module\n",
    "python3 -m trainer.task \\\n",
    "  --train_file_pattern=$TRAIN_FILE_PATTERN \\\n",
    "  --eval_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --output_dir=$PWD/trained_model/dense_labeled \\\n",
    "  --job-dir=./tmp \\\n",
    "  --seq_len=$SEQ_LEN \\\n",
    "  --num_feat=$NUM_FEAT \\\n",
    "  --feat_names=$FEAT_NAMES \\\n",
    "  --feat_defaults=$FEAT_DEFAULTS \\\n",
    "  --train_batch_size=32 \\\n",
    "  --eval_batch_size=32 \\\n",
    "  --previous_train_steps=$PREVIOUS_TRAIN_STEPS \\\n",
    "  --train_examples=$TRAIN_EXAMPLES \\\n",
    "  --start_delay_secs=$START_DELAY_SECS \\\n",
    "  --throttle_secs=$THROTTLE_SECS \\\n",
    "  --model_type=\"dense_autoencoder\" \\\n",
    "  --enc_dnn_hidden_units=$ENC_DNN_HIDDEN_UNITS \\\n",
    "  --latent_vector_size=$LATENT_VECTOR_SIZE \\\n",
    "  --dec_dnn_hidden_units=$DEC_DNN_HIDDEN_UNITS \\\n",
    "  --time_loss_weight=$TIME_LOSS_WEIGHT \\\n",
    "  --feat_loss_weight=$FEAT_LOSS_WEIGHT \\\n",
    "  --training_mode=$TRAINING_MODE \\\n",
    "  --labeled_tune_thresh=$LABELED_TUNE_THRESH \\\n",
    "  --num_time_anom_thresh=$NUM_TIME_ANOM_THRESH \\\n",
    "  --num_feat_anom_thresh=$NUM_FEAT_ANOM_THRESH \\\n",
    "  --min_time_anom_thresh=$MIN_TIME_ANOM_THRESH \\\n",
    "  --max_time_anom_thresh=$MAX_TIME_ANOM_THRESH \\\n",
    "  --min_feat_anom_thresh=$MIN_FEAT_ANOM_THRESH \\\n",
    "  --max_feat_anom_thresh=$MAX_FEAT_ANOM_THRESH \\\n",
    "  --f_score_beta=$F_SCORE_BETA"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### LSTM Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "Tensor(\"IteratorGetNext:5\", shape=(?,), dtype=float64, device=/device:CPU:0)\n",
      "anomaly_detection: mode = \n",
      "train\n",
      "anomaly_detection: params = \n",
      "{'time_loss_weight': 1.0, 'train_examples': 12800, 'seq_len': 30, 'lstm_dropout_output_keep_probs': [0.9, 0.95, 1.0], 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/', 'model_type': 'lstm_enc_dec_autoencoder', 'learning_rate': 0.1, 'feat_loss_weight': 1.0, 'dec_dnn_hidden_units': [64, 256, 1024], 'reverse_labels_sequence': True, 'labeled_tune_thresh': True, 'time_anom_thresh': None, 'throttle_secs': 120, 'start_delay_secs': 60, 'time_thresh_scl': 2.0, 'max_feat_anom_thresh': 80.0, 'eval_batch_size': 32, 'eval_file_pattern': 'data/labeled_val_mixed_seq.csv', 'reconstruction_epochs': 1.0, 'enc_dnn_hidden_units': [1024, 256, 64], 'previous_train_steps': 2200, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'enc_lstm_hidden_units': [64, 32, 16], 'min_time_anom_thresh': 1.0, 'num_feat_anom_thresh': 300, 'k_principal_components_time': None, 'dnn_hidden_units': [1024, 256, 64], 'feat_anom_thresh': None, 'min_feat_anom_thresh': 20.0, 'latent_vector_size': 8, 'dec_lstm_hidden_units': [16, 32, 64], 'training_mode': 'tune_anomaly_thresholds', 'max_time_anom_thresh': 20.0, 'eval_examples': 1024, 'k_principal_components_feat': None, 'f_score_beta': 0.05, 'train_batch_size': 32, 'train_file_pattern': 'data/labeled_val_mixed_seq.csv', 'eps': 1e-12, 'feat_thresh_scl': 2.0, 'autotune_principal_components': False, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'num_feat': 5, 'num_time_anom_thresh': 300}\n",
      "\n",
      "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
      "For more information, please see:\n",
      "  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
      "  * https://github.com/tensorflow/addons\n",
      "If you depend on functionality not listed there, please file an issue.\n",
      "\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "Tensor(\"IteratorGetNext:5\", shape=(?,), dtype=float64, device=/device:CPU:0)\n",
      "anomaly_detection: mode = \n",
      "eval\n",
      "anomaly_detection: params = \n",
      "{'time_loss_weight': 1.0, 'train_examples': 12800, 'seq_len': 30, 'lstm_dropout_output_keep_probs': [0.9, 0.95, 1.0], 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/', 'model_type': 'lstm_enc_dec_autoencoder', 'learning_rate': 0.1, 'feat_loss_weight': 1.0, 'dec_dnn_hidden_units': [64, 256, 1024], 'reverse_labels_sequence': True, 'labeled_tune_thresh': True, 'time_anom_thresh': None, 'throttle_secs': 120, 'start_delay_secs': 60, 'time_thresh_scl': 2.0, 'max_feat_anom_thresh': 80.0, 'eval_batch_size': 32, 'eval_file_pattern': 'data/labeled_val_mixed_seq.csv', 'reconstruction_epochs': 1.0, 'enc_dnn_hidden_units': [1024, 256, 64], 'previous_train_steps': 2200, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'enc_lstm_hidden_units': [64, 32, 16], 'min_time_anom_thresh': 1.0, 'num_feat_anom_thresh': 300, 'k_principal_components_time': None, 'dnn_hidden_units': [1024, 256, 64], 'feat_anom_thresh': None, 'min_feat_anom_thresh': 20.0, 'latent_vector_size': 8, 'dec_lstm_hidden_units': [16, 32, 64], 'training_mode': 'tune_anomaly_thresholds', 'max_time_anom_thresh': 20.0, 'eval_examples': 1024, 'k_principal_components_feat': None, 'f_score_beta': 0.05, 'train_batch_size': 32, 'train_file_pattern': 'data/labeled_val_mixed_seq.csv', 'eps': 1e-12, 'feat_thresh_scl': 2.0, 'autotune_principal_components': False, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'num_feat': 5, 'num_time_anom_thresh': 300}\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_3': <tf.Tensor 'StringToNumber:0' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'StringToNumber_1:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'StringToNumber_2:0' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'StringToNumber_3:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'StringToNumber_4:0' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "infer\n",
      "anomaly_detection: params = \n",
      "{'time_loss_weight': 1.0, 'train_examples': 12800, 'seq_len': 30, 'lstm_dropout_output_keep_probs': [0.9, 0.95, 1.0], 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/', 'model_type': 'lstm_enc_dec_autoencoder', 'learning_rate': 0.1, 'feat_loss_weight': 1.0, 'dec_dnn_hidden_units': [64, 256, 1024], 'reverse_labels_sequence': True, 'labeled_tune_thresh': True, 'time_anom_thresh': None, 'throttle_secs': 120, 'start_delay_secs': 60, 'time_thresh_scl': 2.0, 'max_feat_anom_thresh': 80.0, 'eval_batch_size': 32, 'eval_file_pattern': 'data/labeled_val_mixed_seq.csv', 'reconstruction_epochs': 1.0, 'enc_dnn_hidden_units': [1024, 256, 64], 'previous_train_steps': 2200, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'enc_lstm_hidden_units': [64, 32, 16], 'min_time_anom_thresh': 1.0, 'num_feat_anom_thresh': 300, 'k_principal_components_time': None, 'dnn_hidden_units': [1024, 256, 64], 'feat_anom_thresh': None, 'min_feat_anom_thresh': 20.0, 'latent_vector_size': 8, 'dec_lstm_hidden_units': [16, 32, 64], 'training_mode': 'tune_anomaly_thresholds', 'max_time_anom_thresh': 20.0, 'eval_examples': 1024, 'k_principal_components_feat': None, 'f_score_beta': 0.05, 'train_batch_size': 32, 'train_file_pattern': 'data/labeled_val_mixed_seq.csv', 'eps': 1e-12, 'feat_thresh_scl': 2.0, 'autotune_principal_components': False, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'num_feat': 5, 'num_time_anom_thresh': 300}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using default config.\n",
      "INFO:tensorflow:Using config: {'_num_worker_replicas': 1, '_master': '', '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_save_checkpoints_secs': 600, '_protocol': None, '_is_chief': True, '_experimental_distribute': None, '_service': None, '_save_checkpoints_steps': None, '_task_type': 'worker', '_keep_checkpoint_every_n_hours': 10000, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7fe5af862400>, '_train_distribute': None, '_task_id': 0, '_num_ps_replicas': 0, '_device_fn': None, '_model_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/', '_log_step_count_steps': 100, '_eval_distribute': None, '_tf_random_seed': None, '_global_id_in_cluster': 0, '_keep_checkpoint_max': 5, '_evaluation_master': '', '_save_summary_steps': 100}\n",
      "INFO:tensorflow:Not using Distribute Coordinator.\n",
      "INFO:tensorflow:Running training and evaluation locally (non-distributed).\n",
      "INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after every checkpoint. Checkpoint frequency is determined based on RunConfig arguments: save_checkpoints_steps None or save_checkpoints_secs 600.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:26: BasicLSTMCell.__init__ (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This class is equivalent as tf.keras.layers.LSTMCell, and will be replaced by that in Tensorflow 2.0.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:41: MultiRNNCell.__init__ (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This class is equivalent as tf.keras.layers.StackedRNNCells, and will be replaced by that in Tensorflow 2.0.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:207: static_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Please use `keras.layers.RNN(cell, unroll=True)`, which is equivalent to this API\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py:1259: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.\n",
      "WARNING:tensorflow:From /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/anomaly_detection_module/trainer/autoencoder_lstm.py:225: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use keras.layers.dense instead.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Create CheckpointSaverHook.\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "2019-07-12 20:40:54.659979: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
      "2019-07-12 20:40:54.667022: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:40:54.668406: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x565371532830 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:40:54.668437: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt-2200\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1070: get_checkpoint_mtimes (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file utilities to get mtimes.\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Saving checkpoints for 2200 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt.\n",
      "INFO:tensorflow:loss = 0.0, step = 2201\n",
      "INFO:tensorflow:global_step/sec: 8.28639\n",
      "INFO:tensorflow:loss = 0.0, step = 2301 (12.068 sec)\n",
      "INFO:tensorflow:global_step/sec: 9.434\n",
      "INFO:tensorflow:loss = 0.0, step = 2401 (10.600 sec)\n",
      "INFO:tensorflow:global_step/sec: 8.96279\n",
      "INFO:tensorflow:loss = 0.0, step = 2501 (11.157 sec)\n",
      "INFO:tensorflow:Saving checkpoints for 2600 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/metrics_impl.py:363: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "INFO:tensorflow:Starting evaluation at 2019-07-12T20:41:51Z\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt-2600\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Finished evaluation at 2019-07-12-20:42:24\n",
      "INFO:tensorflow:Saving dict for global step 2600: feat_anom_acc = 1.0, feat_anom_f_beta = 1.0, feat_anom_fn = 0, feat_anom_fp = 0, feat_anom_pre = 1.0, feat_anom_rec = 1.0, feat_anom_tn = 6400, feat_anom_tp = 6400, global_step = 2600, loss = 0.0, time_anom_acc = 1.0, time_anom_f_beta = 1.0, time_anom_fn = 0, time_anom_fp = 0, time_anom_pre = 1.0, time_anom_rec = 1.0, time_anom_tn = 6400, time_anom_tp = 6400\n",
      "INFO:tensorflow:Saving 'checkpoint_path' summary for global step 2600: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt-2600\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/saved_model/signature_def_utils_impl.py:205: build_tensor_info (from tensorflow.python.saved_model.utils_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.utils.build_tensor_info or tf.compat.v1.saved_model.build_tensor_info.\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Eval: None\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Classify: None\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Predict: ['predict_export_outputs', 'serving_default']\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Train: None\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Regress: None\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/model.ckpt-2600\n",
      "INFO:tensorflow:Assets added to graph.\n",
      "INFO:tensorflow:No assets to write.\n",
      "INFO:tensorflow:SavedModel written to: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/lstm_labeled/export/exporter/temp-b'1562964145'/saved_model.pb\n",
      "INFO:tensorflow:Loss for final step: 0.0.\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "export PYTHONPATH=$PYTHONPATH:$PWD/anomaly_detection_module\n",
    "python3 -m trainer.task \\\n",
    "  --train_file_pattern=$TRAIN_FILE_PATTERN \\\n",
    "  --eval_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --output_dir=$PWD/trained_model/lstm_labeled \\\n",
    "  --job-dir=./tmp \\\n",
    "  --seq_len=$SEQ_LEN \\\n",
    "  --num_feat=$NUM_FEAT \\\n",
    "  --feat_names=$FEAT_NAMES \\\n",
    "  --feat_defaults=$FEAT_DEFAULTS \\\n",
    "  --train_batch_size=32 \\\n",
    "  --eval_batch_size=32 \\\n",
    "  --previous_train_steps=$PREVIOUS_TRAIN_STEPS \\\n",
    "  --train_examples=$TRAIN_EXAMPLES \\\n",
    "  --start_delay_secs=$START_DELAY_SECS \\\n",
    "  --throttle_secs=$THROTTLE_SECS \\\n",
    "  --model_type=\"lstm_enc_dec_autoencoder\" \\\n",
    "  --reverse_labels_sequence=$REVERSE_LABELS_SEQUENCE \\\n",
    "  --enc_lstm_hidden_units=$ENC_LSTM_HIDDEN_UNITS \\\n",
    "  --dec_lstm_hidden_units=$DEC_LSTM_HIDDEN_UNITS \\\n",
    "  --lstm_dropout_output_keep_probs=$LSTM_DROPOUT_OUTPUT_KEEP_PROBS \\\n",
    "  --dnn_hidden_units=$DNN_HIDDEN_UNITS \\\n",
    "  --training_mode=$TRAINING_MODE \\\n",
    "  --labeled_tune_thresh=$LABELED_TUNE_THRESH \\\n",
    "  --num_time_anom_thresh=$NUM_TIME_ANOM_THRESH \\\n",
    "  --num_feat_anom_thresh=$NUM_FEAT_ANOM_THRESH \\\n",
    "  --min_time_anom_thresh=$MIN_TIME_ANOM_THRESH \\\n",
    "  --max_time_anom_thresh=$MAX_TIME_ANOM_THRESH \\\n",
    "  --min_feat_anom_thresh=$MIN_FEAT_ANOM_THRESH \\\n",
    "  --max_feat_anom_thresh=$MAX_FEAT_ANOM_THRESH \\\n",
    "  --f_score_beta=$F_SCORE_BETA"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### PCA Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "Tensor(\"IteratorGetNext:5\", shape=(?,), dtype=float64, device=/device:CPU:0)\n",
      "anomaly_detection: mode = \n",
      "train\n",
      "anomaly_detection: params = \n",
      "{'training_mode': 'tune_anomaly_thresholds', 'time_thresh_scl': 2.0, 'train_batch_size': 32, 'dec_lstm_hidden_units': [16, 32, 64], 'previous_train_steps': 2400, 'max_feat_anom_thresh': 80.0, 'reverse_labels_sequence': True, 'eval_batch_size': 32, 'dec_dnn_hidden_units': [64, 256, 1024], 'k_principal_components_feat': None, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'time_loss_weight': 1.0, 'feat_anom_thresh': None, 'model_type': 'pca', 'enc_dnn_hidden_units': [1024, 256, 64], 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', 'eps': 1e-12, 'throttle_secs': 120, 'start_delay_secs': 60, 'min_time_anom_thresh': 1.0, 'num_feat': 5, 'feat_thresh_scl': 2.0, 'num_time_anom_thresh': 300, 'train_file_pattern': 'data/labeled_val_mixed_seq.csv', 'train_examples': 12800, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'seq_len': 30, 'enc_lstm_hidden_units': [64, 32, 16], 'num_feat_anom_thresh': 300, 'eval_examples': 1024, 'latent_vector_size': 8, 'min_feat_anom_thresh': 20.0, 'max_time_anom_thresh': 20.0, 'learning_rate': 0.1, 'feat_loss_weight': 1.0, 'eval_file_pattern': 'data/labeled_val_mixed_seq.csv', 'autotune_principal_components': False, 'k_principal_components_time': None, 'dnn_hidden_units': [1024, 256, 64], 'reconstruction_epochs': 1.0, 'f_score_beta': 0.05, 'labeled_tune_thresh': True, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'time_anom_thresh': None}\n",
      "\n",
      "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
      "For more information, please see:\n",
      "  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
      "  * https://github.com/tensorflow/addons\n",
      "If you depend on functionality not listed there, please file an issue.\n",
      "\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_2': <tf.Tensor 'IteratorGetNext:2' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'IteratorGetNext:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'IteratorGetNext:1' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'IteratorGetNext:4' shape=(?, 30) dtype=float64>, 'tag_3': <tf.Tensor 'IteratorGetNext:3' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "Tensor(\"IteratorGetNext:5\", shape=(?,), dtype=float64, device=/device:CPU:0)\n",
      "anomaly_detection: mode = \n",
      "eval\n",
      "anomaly_detection: params = \n",
      "{'training_mode': 'tune_anomaly_thresholds', 'time_thresh_scl': 2.0, 'train_batch_size': 32, 'dec_lstm_hidden_units': [16, 32, 64], 'previous_train_steps': 2400, 'max_feat_anom_thresh': 80.0, 'reverse_labels_sequence': True, 'eval_batch_size': 32, 'dec_dnn_hidden_units': [64, 256, 1024], 'k_principal_components_feat': None, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'time_loss_weight': 1.0, 'feat_anom_thresh': None, 'model_type': 'pca', 'enc_dnn_hidden_units': [1024, 256, 64], 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', 'eps': 1e-12, 'throttle_secs': 120, 'start_delay_secs': 60, 'min_time_anom_thresh': 1.0, 'num_feat': 5, 'feat_thresh_scl': 2.0, 'num_time_anom_thresh': 300, 'train_file_pattern': 'data/labeled_val_mixed_seq.csv', 'train_examples': 12800, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'seq_len': 30, 'enc_lstm_hidden_units': [64, 32, 16], 'num_feat_anom_thresh': 300, 'eval_examples': 1024, 'latent_vector_size': 8, 'min_feat_anom_thresh': 20.0, 'max_time_anom_thresh': 20.0, 'learning_rate': 0.1, 'feat_loss_weight': 1.0, 'eval_file_pattern': 'data/labeled_val_mixed_seq.csv', 'autotune_principal_components': False, 'k_principal_components_time': None, 'dnn_hidden_units': [1024, 256, 64], 'reconstruction_epochs': 1.0, 'f_score_beta': 0.05, 'labeled_tune_thresh': True, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'time_anom_thresh': None}\n",
      "\n",
      "anomaly_detection: features = \n",
      "{'tag_3': <tf.Tensor 'StringToNumber_1:0' shape=(?, 30) dtype=float64>, 'tag_0': <tf.Tensor 'StringToNumber_2:0' shape=(?, 30) dtype=float64>, 'tag_4': <tf.Tensor 'StringToNumber_3:0' shape=(?, 30) dtype=float64>, 'tag_1': <tf.Tensor 'StringToNumber:0' shape=(?, 30) dtype=float64>, 'tag_2': <tf.Tensor 'StringToNumber_4:0' shape=(?, 30) dtype=float64>}\n",
      "anomaly_detection: labels = \n",
      "None\n",
      "anomaly_detection: mode = \n",
      "infer\n",
      "anomaly_detection: params = \n",
      "{'training_mode': 'tune_anomaly_thresholds', 'time_thresh_scl': 2.0, 'train_batch_size': 32, 'dec_lstm_hidden_units': [16, 32, 64], 'previous_train_steps': 2400, 'max_feat_anom_thresh': 80.0, 'reverse_labels_sequence': True, 'eval_batch_size': 32, 'dec_dnn_hidden_units': [64, 256, 1024], 'k_principal_components_feat': None, 'feat_names': ['tag_0', 'tag_1', 'tag_2', 'tag_3', 'tag_4'], 'time_loss_weight': 1.0, 'feat_anom_thresh': None, 'model_type': 'pca', 'enc_dnn_hidden_units': [1024, 256, 64], 'output_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', 'eps': 1e-12, 'throttle_secs': 120, 'start_delay_secs': 60, 'min_time_anom_thresh': 1.0, 'num_feat': 5, 'feat_thresh_scl': 2.0, 'num_time_anom_thresh': 300, 'train_file_pattern': 'data/labeled_val_mixed_seq.csv', 'train_examples': 12800, 'feat_defaults': [['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0'], ['0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0']], 'seq_len': 30, 'enc_lstm_hidden_units': [64, 32, 16], 'num_feat_anom_thresh': 300, 'eval_examples': 1024, 'latent_vector_size': 8, 'min_feat_anom_thresh': 20.0, 'max_time_anom_thresh': 20.0, 'learning_rate': 0.1, 'feat_loss_weight': 1.0, 'eval_file_pattern': 'data/labeled_val_mixed_seq.csv', 'autotune_principal_components': False, 'k_principal_components_time': None, 'dnn_hidden_units': [1024, 256, 64], 'reconstruction_epochs': 1.0, 'f_score_beta': 0.05, 'labeled_tune_thresh': True, 'lstm_dropout_output_keep_probs': [1.0, 1.0, 1.0], 'time_anom_thresh': None}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using default config.\n",
      "INFO:tensorflow:Using config: {'_experimental_distribute': None, '_service': None, '_train_distribute': None, '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_keep_checkpoint_every_n_hours': 10000, '_keep_checkpoint_max': 5, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f4b4d682390>, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_num_ps_replicas': 0, '_global_id_in_cluster': 0, '_is_chief': True, '_model_dir': '/home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/', '_tf_random_seed': None, '_master': '', '_evaluation_master': '', '_log_step_count_steps': 100, '_eval_distribute': None, '_task_type': 'worker', '_save_checkpoints_secs': 600, '_protocol': None, '_task_id': 0, '_device_fn': None, '_num_worker_replicas': 1}\n",
      "INFO:tensorflow:Not using Distribute Coordinator.\n",
      "INFO:tensorflow:Running training and evaluation locally (non-distributed).\n",
      "INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after every checkpoint. Checkpoint frequency is determined based on RunConfig arguments: save_checkpoints_steps None or save_checkpoints_secs 600.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "INFO:tensorflow:Create CheckpointSaverHook.\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "2019-07-12 20:42:36.467826: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
      "2019-07-12 20:42:36.475457: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:42:36.476667: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x556db5b9e9f0 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:42:36.476720: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2400\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1070: get_checkpoint_mtimes (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file utilities to get mtimes.\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Saving checkpoints for 2400 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt.\n",
      "INFO:tensorflow:loss = 0.0, step = 2401\n",
      "INFO:tensorflow:global_step/sec: 27.5062\n",
      "INFO:tensorflow:loss = 0.0, step = 2501 (3.636 sec)\n",
      "INFO:tensorflow:global_step/sec: 35.0241\n",
      "INFO:tensorflow:loss = 0.0, step = 2601 (2.855 sec)\n",
      "INFO:tensorflow:global_step/sec: 36.3817\n",
      "INFO:tensorflow:loss = 0.0, step = 2701 (2.749 sec)\n",
      "INFO:tensorflow:Saving checkpoints for 2800 into /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt.\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/ops/metrics_impl.py:363: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "INFO:tensorflow:Starting evaluation at 2019-07-12T20:42:50Z\n",
      "INFO:tensorflow:Graph was finalized.\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2800\n",
      "INFO:tensorflow:Running local_init_op.\n",
      "INFO:tensorflow:Done running local_init_op.\n",
      "INFO:tensorflow:Finished evaluation at 2019-07-12-20:42:53\n",
      "INFO:tensorflow:Saving dict for global step 2800: feat_anom_acc = 1.0, feat_anom_f_beta = 1.0, feat_anom_fn = 0, feat_anom_fp = 0, feat_anom_pre = 1.0, feat_anom_rec = 1.0, feat_anom_tn = 6400, feat_anom_tp = 6400, global_step = 2800, loss = 0.0, time_anom_acc = 1.0, time_anom_f_beta = 1.0, time_anom_fn = 0, time_anom_fp = 0, time_anom_pre = 1.0, time_anom_rec = 1.0, time_anom_tn = 6400, time_anom_tp = 6400\n",
      "INFO:tensorflow:Saving 'checkpoint_path' summary for global step 2800: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2800\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:Done calling model_fn.\n",
      "WARNING:tensorflow:From /home/jupyter/.local/lib/python3.5/site-packages/tensorflow/python/saved_model/signature_def_utils_impl.py:205: build_tensor_info (from tensorflow.python.saved_model.utils_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.utils.build_tensor_info or tf.compat.v1.saved_model.build_tensor_info.\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Classify: None\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Predict: ['predict_export_outputs', 'serving_default']\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Eval: None\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Regress: None\n",
      "INFO:tensorflow:Signatures INCLUDED in export for Train: None\n",
      "INFO:tensorflow:Restoring parameters from /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/model.ckpt-2800\n",
      "INFO:tensorflow:Assets added to graph.\n",
      "INFO:tensorflow:No assets to write.\n",
      "INFO:tensorflow:SavedModel written to: /home/jupyter/artificial_intelligence/machine_learning/anomaly_detection/tf_anomaly_detection_model_selection/trained_model/pca_labeled/export/exporter/temp-b'1562964173'/saved_model.pb\n",
      "INFO:tensorflow:Loss for final step: 0.0.\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "export PYTHONPATH=$PYTHONPATH:$PWD/anomaly_detection_module\n",
    "python3 -m trainer.task \\\n",
    "  --train_file_pattern=$TRAIN_FILE_PATTERN \\\n",
    "  --eval_file_pattern=$EVAL_FILE_PATTERN \\\n",
    "  --output_dir=$PWD/trained_model/pca_labeled \\\n",
    "  --job-dir=./tmp \\\n",
    "  --seq_len=$SEQ_LEN \\\n",
    "  --num_feat=$NUM_FEAT \\\n",
    "  --feat_names=$FEAT_NAMES \\\n",
    "  --feat_defaults=$FEAT_DEFAULTS \\\n",
    "  --train_batch_size=32 \\\n",
    "  --eval_batch_size=32 \\\n",
    "  --previous_train_steps=2400 \\\n",
    "  --train_examples=$TRAIN_EXAMPLES \\\n",
    "  --start_delay_secs=$START_DELAY_SECS \\\n",
    "  --throttle_secs=$THROTTLE_SECS \\\n",
    "  --model_type=\"pca\" \\\n",
    "  --training_mode=$TRAINING_MODE \\\n",
    "  --labeled_tune_thresh=$LABELED_TUNE_THRESH \\\n",
    "  --num_time_anom_thresh=$NUM_TIME_ANOM_THRESH \\\n",
    "  --num_feat_anom_thresh=$NUM_FEAT_ANOM_THRESH \\\n",
    "  --min_time_anom_thresh=$MIN_TIME_ANOM_THRESH \\\n",
    "  --max_time_anom_thresh=$MAX_TIME_ANOM_THRESH \\\n",
    "  --min_feat_anom_thresh=$MIN_FEAT_ANOM_THRESH \\\n",
    "  --max_feat_anom_thresh=$MAX_FEAT_ANOM_THRESH \\\n",
    "  --f_score_beta=$F_SCORE_BETA"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Prediction"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "UNLABELED_CSV_COLUMNS = [\"tag_{0}\".format(tag) for tag in range(0, 5)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "labeled_test_mixed_sequences_array.shape = (12800, 6)\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "labeled_test_mixed_sequences_array = np.loadtxt(\n",
    "    fname=\"data/labeled_test_mixed_seq.csv\", dtype=str, delimiter=\",\")\n",
    "print(\"labeled_test_mixed_sequences_array.shape = {}\".format(\n",
    "    labeled_test_mixed_sequences_array.shape))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "labels = ['0' '0' '0' '0' '0' '0' '1' '1' '1' '0']\n"
     ]
    }
   ],
   "source": [
    "number_of_prediction_instances = 10\n",
    "print(\"labels = {}\".format(\n",
    "  labeled_test_mixed_sequences_array[0:number_of_prediction_instances, -1]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Local prediction from local model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"tag_0\": \"0.66491856;1.9145195;1.75234653;-0.78400576;-0.75609776;0.84197907;2.33069302;0.67758695;-1.60418555;-0.16573821;1.65752209;1.38322258;-0.65379731;-0.98907577;0.85974301;2.28947191;1.30827902;-1.28121539;-0.84517686;1.16128253;2.54710653;-0.07715313;-0.99222116;-0.14657169;2.05595855;1.51383899;-0.53623582;-0.75514892;0.48173323;2.3100255\", \"tag_1\": \"0.14611996;1.91715205;-0.37882894;0.21415584;2.12791802;-0.0619942;0.11572278;1.93012199;0.6541758;-0.68204207;1.56716207;0.75419849;-0.37778253;1.57716806;1.37025903;-1.14077495;1.15195495;1.68996712;-0.81952461;0.85177925;1.21750258;-0.15392611;-0.18813038;2.1498899;0.22421678;-0.30835851;1.58292183;-0.08034281;-0.51606627;2.0111497\", \"tag_2\": \"0.93582327;1.42382616;2.07416534;0.66961254;-0.45530108;-0.33779627;1.29564858;1.57718875;1.62194094;-0.50371325;-0.68795334;-0.21823157;1.67758936;1.87901361;0.89202323;-1.15923235;-0.39328089;1.03425895;1.62499189;1.47040884;0.40736898;-1.1339056;-0.29514493;1.74666228;2.22234859;0.66564559;-0.7699364;-0.64337751;0.32518635;1.48844008\", \"tag_3\": \"0.55496827;1.63017531;-0.17487062;-0.14967874;2.12154598;0.98646297;-0.89614069;0.16462197;1.48088977;-0.2009814;-0.7492661;1.41074009;1.49459742;-0.78390433;0.96362317;2.35191643;0.01970021;-0.30345158;1.84212884;0.63518639;-1.26010881;0.84082203;2.33136081;-0.67124369;-0.70904769;1.48210016;0.858758;-1.31116881;0.49555797;1.40730677\", \"tag_4\": \"0.09135211;2.01834776;0.97056041;-0.1594919;-0.62361487;0.47084415;1.44724272;1.15545605;-0.64437793;-0.18398029;1.1087019;2.06215052;0.45822295;-0.61682919;-0.29801659;0.82097915;1.61374037;0.41494366;-1.0210058;-0.21951907;1.65998406;1.83563618;-0.25813724;-0.13240912;0.38837674;1.99312546;1.22683365;-0.4224495;-0.18025518;0.08359485\"}\n",
      "{\"tag_0\": \"0.17719106;2.36471116;1.33668375;-0.4400062;-1.25963378;1.73031706;2.58521375;0.11354567;-1.11310486;-0.32198926;1.51152682;2.13049867;-0.35512449;-1.27345835;0.54471967;2.6967149;0.86732941;-1.24531881;-0.42520021;1.44453372;1.94324334;0.40487656;-1.015864;0.25622177;1.77878128;1.57045202;-0.79358892;-1.3590808;0.73755601;2.62965859\", \"tag_1\": \"0.71030153;1.8669475;-0.09171495;-0.17981998;2.22558183;-0.14653793;-0.40682499;1.55818913;0.34023437;-0.21518259;1.86580895;0.86045721;-0.6714036;1.13412677;0.8525273;-0.48981632;1.17631327;1.59408396;-0.78513187;1.1368699;1.7272055;-0.03057556;0.53859453;1.69313548;0.226495;-0.10393593;1.44571603;-0.07160673;-0.73000503;1.86491928\", \"tag_2\": \"0.09367139;1.33746674;1.9004417;-0.21943487;-1.31156289;0.09949706;1.15835086;1.53605551;1.30479204;0.15526542;-0.41549426;0.04660619;1.80027446;2.14560549;1.0622532;-0.38149954;-0.43315075;0.65333784;1.4824436;0.97490262;-0.36708224;-1.01950586;0.18231947;1.00474388;2.17614239;0.85310003;-0.94154304;-0.97572663;0.2814986;2.11980224\", \"tag_3\": \"0.43296269;2.23009529;-0.48612455;-0.36227708;1.45665627;0.75931715;-1.18570904;0.44684432;1.794074;0.12783238;-0.99541007;2.04215917;1.53342289;-0.48745935;0.91976961;2.02896366;0.07280475;-0.82926737;1.65608629;0.57029549;-0.96460788;0.66030174;1.88675877;-0.30225988;-0.12357446;2.07062348;0.66685794;-0.56192636;0.92809804;1.80654295\", \"tag_4\": \"0.587145;1.35353767;0.9576224;0.12748192;-0.56293386;0.94937899;1.53220376;1.18329597;-0.02936159;0.10863562;0.63922954;1.49684617;0.98793307;-0.64285446;-0.54617024;1.54162035;1.61626536;0.67105137;-0.38921715;0.48454694;0.97877305;1.24861088;0.1069746;-0.6347279;-0.04215181;1.26183669;1.56819848;0.32655155;-0.10546471;0.3429311\"}\n",
      "{\"tag_0\": \"0.56407532;2.21735549;1.48425456;-0.4582741;-0.74001439;1.17780382;2.51229789;0.81291222;-0.89756718;-0.04710926;2.26889544;2.08856754;-0.34440918;-1.26350166;0.82788279;2.41310829;0.8713713;-0.77068466;-1.29778275;1.51732726;2.08484064;0.11026772;-0.93499246;0.31454002;2.03869059;2.17338;0.02256827;-0.76568536;0.223173;2.41177806\", \"tag_1\": \"0.99841597;1.8766039;-0.67996731;-0.36469926;2.02594307;-0.40838761;-0.70422727;1.60641465;0.30621662;-0.59939678;1.82428969;0.74964436;-0.19356367;1.11676055;1.45679273;-0.30363095;0.88551093;1.61644233;-0.86644429;0.64232134;1.86929387;-0.56763947;0.28351136;1.2989801;0.07792312;0.20716147;1.3108805;-0.35569196;-0.83411026;2.03297332\", \"tag_2\": \"0.79596068;1.78534899;1.18440192;0.6851619;-0.51180857;-0.64516618;0.859677;1.81742657;1.00894047;-0.02323468;-1.32522709;0.59765354;1.22555665;2.10937369;0.93312951;-0.93750619;-0.21586528;1.09578856;1.76662781;1.33824507;0.38463941;-0.40313816;-0.51195442;1.69684109;2.37203636;1.17955189;-0.94215326;-0.77441587;0.14614711;1.85351877\", \"tag_3\": \"0.56405834;2.3395669;0.01928487;-0.88295555;1.38164722;0.93342287;-0.98667119;0.69532375;2.16844925;-0.19033075;-0.12080565;1.47695624;1.2454856;-0.64102547;0.60170497;2.33863214;0.07862161;-0.53523123;1.59156042;1.40543765;-1.21651573;0.86007653;2.3446296;0.14265097;-0.55523953;1.66811979;0.8424894;-0.59742515;1.12757917;2.20907267\", \"tag_4\": \"0.94153508;1.9210392;1.23240201;0.19354849;-0.02721869;0.32052958;1.2136126;0.35832705;-0.82980208;-0.09731961;1.41645797;1.97141205;0.18904187;-0.98276332;-0.59979095;1.61790449;1.22859036;0.19796442;-1.08586748;0.10717925;1.10829904;1.60354724;0.37362338;-0.61213502;-0.10515549;1.70933596;0.97441548;0.11367894;-0.55315244;0.41229579\"}\n",
      "{\"tag_0\": \"0.42126312;1.91613205;1.15577886;-0.51229836;-0.56412723;1.78292241;1.9655619;0.61294146;-0.84437795;0.21312217;1.74664349;1.88352544;-0.5116456;-1.02126818;0.73948334;2.52338096;0.74412904;-1.35536017;-0.59437695;1.4454396;2.2661811;0.77992007;-1.22885127;-0.45589788;1.96042996;1.72453031;-0.42378919;-1.14939038;0.95947915;2.21788557\", \"tag_1\": \"0.83495192;1.72642886;-0.69048477;-0.15195203;1.81144859;-0.42598887;-0.62738702;1.91878794;-0.08209937;-0.88814676;1.3766724;0.72756088;-1.15848756;1.37880414;0.86606965;-0.77535041;0.67921471;0.83980365;-0.41557283;1.15811811;1.14488711;-0.68099151;0.56917152;1.51629663;-0.74655844;-0.35079936;2.04346636;0.01299723;-0.70726465;1.65701281\", \"tag_2\": \"0.76809582;1.89351557;1.68027055;-0.01449823;-0.76833814;0.06323329;0.81700795;2.06601228;1.52797847;0.15271752;-1.09156426;0.04857706;1.9033371;1.51497711;0.51402321;-0.62353928;-0.75683717;0.47646536;2.1032838;1.5209599;-0.29563802;-1.08365054;0.19123748;0.84269981;2.34527762;0.88959519;-0.15693771;-1.08716567;0.32190664;1.89654211\", \"tag_3\": \"0.72446044;1.7897659;-0.5995043;-0.29050033;1.59976153;1.55619488;-1.07504783;0.76942606;1.73877153;0.04319877;-0.65155011;1.41514951;1.23854522;-0.7096767;0.72825959;1.60513711;0.2605117;-0.88187029;1.82338286;1.43733909;-0.97684025;0.22276613;2.16613619;-0.43187756;-0.96124318;1.82670802;1.21815652;-1.15328814;1.09508608;1.35338326\", \"tag_4\": \"0.74212608;1.60065456;1.44689852;-0.20538241;-0.23862303;0.98306409;2.08869005;0.71335664;-0.36451671;0.05793743;0.59341791;1.49433147;0.56347407;-0.22791291;-0.30649144;1.4044681;1.19468166;0.0759247;-0.24974403;-0.36999676;1.50435203;1.43292034;0.23921067;-1.09305809;0.08724514;1.80554213;1.56683133;-0.04704193;-0.66817036;0.43310227\"}\n",
      "{\"tag_0\": \"0.72579761;2.47522531;1.327882;-0.75268684;-1.1781596;1.8190688;2.75720961;0.36062891;-0.83751352;-0.71114497;1.94022901;1.66131344;-0.31676063;-0.97258012;0.64972194;2.63356231;1.00750943;-1.47431186;-0.72892581;1.50185207;2.21181981;0.2661509;-1.25935447;0.30660896;1.88079632;1.61985348;-0.05001294;-0.84116216;0.34933468;2.13577794\", \"tag_1\": \"0.28667536;1.38474681;-0.65711262;0.24981812;1.58942549;-0.16474207;-0.61395175;1.49868725;0.45787859;-0.41612629;1.41471588;0.41348958;-0.80739775;1.49833563;1.48766394;-0.45534772;0.70898202;0.98323878;-0.74497386;0.64891817;1.63324152;-0.03950937;0.05579431;1.54732627;-0.66710993;-0.35114065;1.53111315;-0.01973695;-0.37731297;1.75623545\", \"tag_2\": \"0.90848602;2.21676242;1.85921972;-0.24197257;-0.9100976;0.00275013;1.00053774;1.40055928;0.74702449;-0.50267597;-0.84651481;0.2292874;1.98407809;2.26690591;0.9022541;-1.13558066;-0.21949626;1.04933645;1.6770574;1.55207594;-0.14044969;-0.86823706;-0.28564309;1.74831191;1.70918509;1.12008136;-0.04343257;-0.9626134;-0.09400303;2.07010619\", \"tag_3\": \"0.95364124;1.73729486;-0.46975947;-0.60177623;1.60340907;1.05856077;-1.1101516;0.45645482;2.09716668;-0.21975787;-0.38319073;2.05270447;1.16664725;-1.21537023;0.25826675;2.25034501;-0.60087805;-0.49597547;1.33748965;1.42932051;-0.60206741;1.00846474;1.58231814;-0.5112769;-0.98310747;1.87652975;0.88289004;-1.03286975;0.93315793;2.15740461\", \"tag_4\": \"0.40835687;1.56538177;1.37825225;0.08545293;-0.70862794;0.88269748;1.16281691;1.07729888;-0.90948711;-0.60861432;1.48940031;2.04036648;0.14156203;-0.44991055;-0.2542472;1.37231589;1.79903228;0.09845316;-0.64955625;0.32648146;1.18872066;1.24506551;-0.0067401;-0.50290517;0.33286966;1.43410147;1.71245797;-0.58743568;-0.95471011;0.93948165\"}\n",
      "{\"tag_0\": \"0.32586937;2.08483849;1.75075176;-1.3336731;-1.17097551;0.97406564;1.7887734;0.08011179;-1.08188674;-0.05479934;1.99891319;1.61133871;-0.71490799;-0.99111498;0.87641865;2.61951522;0.81368508;-0.72022372;-1.31567318;0.98415183;1.75673683;0.24764211;-1.37138841;-0.00938338;2.49622452;1.93360966;-0.8683438;-1.02346433;0.22796142;2.17651303\", \"tag_1\": \"0.88830138;1.40762486;-0.89037037;-0.24249388;1.91719852;-0.01578304;-0.08442717;1.55637788;-0.12647233;-0.38200814;1.6873275;0.98669163;-1.14192299;1.31623504;0.53457028;-0.55379481;1.41801087;1.68637843;-0.93578977;0.94078648;1.1668302;-0.32543639;0.656733;1.68649731;0.12277812;0.29430548;1.32494733;0.39247261;-0.66217234;1.33253825\", \"tag_2\": \"0.81516693;1.60512581;1.6907453;0.22479972;-0.95582798;-0.27743592;0.69123689;2.17858567;1.0722736;-0.30677606;-0.75284401;-0.34243141;1.70903897;1.86075445;1.07625646;-0.75971642;-1.11335946;0.37604343;1.86715537;1.09562839;-0.33711711;-1.36609983;-0.22295621;0.90491489;1.75689099;0.92176145;-0.77558837;-1.15932892;0.60134914;1.8090888\", \"tag_3\": \"0.4737608;1.73244784;0.23163436;-0.9631771;1.49774874;1.58665541;-0.44556445;0.34738166;1.59298496;-0.15497374;-0.79636535;1.60591865;1.12169701;-0.64230298;0.38073256;2.18393302;-0.50269062;-0.95453435;1.19402396;1.26136721;-1.40427224;0.98199957;1.47015842;-0.17585038;-0.28801113;1.24829305;1.12020913;-1.40855673;0.51226752;2.27812881\", \"tag_4\": \"0.69678881;1.17885307;1.44638281;-0.70780262;-0.62696339;0.36653819;1.92369006;0.70271121;-0.29447236;-0.28310942;0.85425089;1.94911456;0.38299738;-0.96769782;0.15079265;1.50539141;1.1608814;0.6075995;-0.87810787;-0.24271358;1.14046976;1.12508366;0.35562226;-0.1424098;-0.17615414;1.69186414;0.92168567;-0.31295013;-0.44942316;0.15731019\"}\n",
      "{\"tag_0\": \"0.51050055;2.69389578;1.25894302;-0.77298241;-0.89719575;1.24131578;2.43433832;0.69897498;-1.42118052;0.23639712;2.10150457;1.37300574;-0.73292098;-1.04882182;0.64958206;2.15595112;1.27492057;-0.58570506;-1.15496434;0.9569437;1.84614769;7.2838498;28.68679059;3.68852023;41.20186049;25.79408803;4.07374501;-18.21477023;7.88766113;-31.413113\", \"tag_1\": \"0.32816545;2.03168341;-0.50770387;-0.09223325;2.18201483;-0.57779839;-0.68059114;1.82432731;0.11727799;-0.4752929;1.13392897;0.72933341;-0.58817182;1.24613585;1.31511175;-0.62279865;0.74081665;1.27299271;-1.08821874;0.70929033;1.07553303;-0.55135701;0.59198618;28.72731254;8.63084852;-4.51672999;-28.62139419;6.26020798;3.07549138;-21.37796897\", \"tag_2\": \"1.75172880e-01;2.05535240e+00;1.44003648e+00;5.17610212e-01;-1.12973153e+00;-4.41912631e-01;9.45471325e-01;1.50171682e+00;1.12132048e+00;-3.79924419e-01;-8.97876304e-01;3.20491103e-01;2.01208300e+00;1.56316061e+00;4.18401802e-01;-2.36201103e-01;-4.05905271e-01;9.67094333e-01;1.47189522e+00;1.67081141e+00;-2.83967475e-02;-1.49912774e+01;2.50368069e+00;1.39946933e+01;-2.98725861e+01;-2.60266709e+01;6.78922731e+00;-9.22078879e+00;1.12866692e+01;3.34847886e+01\", \"tag_3\": \"0.9398891;2.14676813;0.31705662;-0.75858031;1.87535511;1.10697737;-1.38074992;0.90715747;1.98787289;-0.53331953;-0.162247;1.85005092;1.25558865;-0.44769547;1.05049323;1.38079449;0.25674551;-0.09597546;1.25296602;0.91029229;-1.3604584;-6.87075078;30.16100196;13.73234042;9.54641123;-14.95928707;13.17329063;11.59449353;-8.69392126;19.89690794\", \"tag_4\": \"0.88440641;1.84351933;1.2522011;-0.04731375;-0.24563516;0.93245825;1.34810386;1.16530004;-0.82167278;-0.30757919;0.98430533;1.56121188;0.45867778;-0.13653135;-0.38089532;0.94985839;1.74326557;0.52395315;-0.72746284;0.21332402;1.81347259;-22.50918043;-2.03767266;-9.76303956;4.53970771;18.65899107;23.85139048;-4.29725835;10.15250383;-4.12923311\"}\n",
      "{\"tag_0\": \"0.29132869;1.94811937;1.7276976;-0.60992108;-1.26241941;1.47374999;2.36994795;0.1789954;-1.17736161;-0.46428297;2.37934236;1.97664288;-0.52773977;-1.68253872;1.07443294;2.71698415;1.6045785;-0.9920012;-1.09397133;1.20741447;1.80885343;1.34405876;20.67932055;-1.14022578;-28.40089904;16.12079604;7.38124482;12.12622874;15.13166867;32.90880771\", \"tag_1\": \"0.8557475;1.93360377;-0.31294082;0.44979634;1.25960367;-0.2857751;-0.70045919;1.39591933;-0.13365899;-0.8439945;1.13747472;0.96123988;-0.66921742;1.3574706;1.36003416;-0.89376979;0.90144892;0.8535824;-0.26671179;0.22671035;1.30298162;-4.18913156;0.9468949;-29.00931534;7.04472224;-1.42687889;14.47096118;7.51008681;6.87904454;13.9561642\", \"tag_2\": \"0.5217148;2.09703312;1.31606867;-0.26721771;-0.99434981;0.03704256;1.42266911;1.5446208;0.77225229;-0.2169492;-0.49256149;0.26210229;1.05365803;1.85281788;1.02462949;-0.78701173;-1.09867346;1.10725097;1.63491138;1.24112625;-0.34997672;-11.91426406;1.07551952;20.95590433;-24.12025401;21.56245775;3.69156376;20.35730663;6.46974537;13.42841392\", \"tag_3\": \"0.47092471;1.49090388;-0.13276539;-0.14971593;1.70488311;1.54542686;-1.15809336;0.08510231;1.88856105;-0.49502568;-0.94090189;1.80752917;0.55999976;-0.80192163;0.15138497;1.69377715;-0.17549086;-0.52699769;1.52603672;1.37259062;-1.31313875;10.29232846;-26.04833009;-0.37512849;9.19901589;-16.41114362;-25.87962079;7.07386449;-8.11152706;-26.57871917\", \"tag_4\": \"1.16552148e-01;1.47797459e+00;1.21258438e+00;-2.30026774e-02;-7.20304694e-01;3.00584391e-01;2.11149651e+00;1.25044571e+00;-2.15272110e-01;-6.36431860e-01;5.75934353e-01;2.01473045e+00;1.52349682e-01;-6.89695707e-01;-2.69293988e-01;8.88487864e-01;1.85078337e+00;7.05725023e-01;-6.37721453e-01;-3.67707435e-01;1.81040324e+00;1.14022841e+01;1.41792767e+00;-1.80681124e+01;1.15542589e+01;2.43209890e+01;-1.42527562e+01;1.42548515e+00;-1.44897947e+01;7.35681180e+00\"}\n",
      "{\"tag_0\": \"0.0266561;2.11295685;0.84281539;-0.49503168;-1.18619684;1.53450346;2.59183152;0.05013556;-1.43063062;-0.04718107;1.59537505;2.30320994;-0.70494473;-0.79954149;0.61767168;2.03670536;1.56815847;-0.55904809;-0.98331514;1.79599943;2.36509411;-8.97326176;11.79496445;-6.21452245;23.37675169;-26.45932154;-1.82586441;-17.00978883;-11.42588866;26.41579881\", \"tag_1\": \"2.27730874e-01;1.74734270e+00;1.07832767e-02;-9.72417712e-02;2.17616114e+00;-4.88667993e-01;-2.67610076e-01;1.69136828e+00;6.42575329e-02;-2.57197525e-01;1.72384798e+00;9.36201398e-01;-3.07668556e-01;1.81908032e+00;9.01756832e-01;-6.80441792e-01;1.27233123e+00;1.45780828e+00;-4.81722748e-01;1.60838820e-01;1.28510952e+00;9.30987584e+00;1.04554355e+01;-2.50792477e+01;3.04080828e-01;-4.48267885e+00;1.09099535e+01;3.69566599e+00;5.92624619e+00;-1.81082616e+01\", \"tag_2\": \"0.06343853;1.9124796;1.7756218;-0.03078451;-0.55164198;-0.19553961;1.39801553;1.57590058;1.18183893;-0.03955416;-0.47674046;0.04204849;1.65532651;1.42349039;0.7118908;-1.12871284;-0.57391866;1.15819722;2.31395329;1.73066558;-0.2845753;-13.32688457;2.62680401;18.37623135;-13.44823607;-12.58663013;14.48300707;9.90008467;-0.09487463;17.40007667\", \"tag_3\": \"0.12282237;2.07993394;-0.52944738;-0.68663188;1.17090808;0.65621051;-0.67362715;0.11684809;1.79278833;-0.14167161;-0.10092116;1.88432723;1.25762303;-1.2240933;1.03084159;1.55835716;-0.24365917;-0.69771459;1.79552698;0.71852079;-0.46969943;11.62093989;-25.39511668;4.3249073;-10.84026304;-12.99393421;15.0325705;-12.19589652;-8.03079308;-40.59071569\", \"tag_4\": \"0.69583932;1.14584373;0.96670326;-0.44210325;-0.59606549;0.33030086;1.45365818;0.57344436;-0.71515938;-0.08404491;0.8561574;1.3807949;0.62253036;-0.81216214;-0.43765282;1.09031985;1.25787573;-0.0741466;-0.97568411;-0.05445147;0.94227557;-22.29941375;6.85443505;21.8427763;-6.74829032;-23.70348229;-9.44233507;4.29718812;8.36262444;-2.34221339\"}\n",
      "{\"tag_0\": \"0.04002373;2.77047149;1.18899767;-0.60047226;-1.33342528;0.9332609;1.79713745;0.12207074;-1.54002434;0.12563447;1.65582437;2.16662805;-0.27858593;-1.33363261;0.63004838;2.60991971;1.54024527;-0.56917252;-0.72655791;1.15147733;2.50307969;0.34091677;-1.78544364;0.0469913;2.3052051;1.82387952;-0.12610546;-1.5179853;1.08815115;2.71393575\", \"tag_1\": \"0.77316403;1.78993695;-0.00996767;0.06333012;1.74399522;-0.40204323;-0.3841756;2.08135886;-0.05024028;-0.53364949;2.07842082;0.61253916;-0.539925;0.96458172;0.93248708;-0.46253491;1.1020334;1.59779402;-0.86248362;0.97942725;1.28409853;-0.41827883;-0.21428836;1.3041642;0.13853662;-0.37642735;1.32348276;-0.03971839;-0.28628336;1.53879333\", \"tag_2\": \"0.5064642;1.73569998;1.15883707;0.32626716;-0.93921306;-0.61178983;1.45841529;1.66214296;0.94871562;-0.40083787;-1.33746892;-0.17665792;1.81168659;1.70129509;1.07749217;-0.68119423;-0.23273985;0.39928992;1.4249041;1.33871969;0.37569222;-0.40994081;0.21717019;1.18499547;2.23490559;0.54602336;-0.17562612;-0.69806029;0.52470708;2.11374314\", \"tag_3\": \"0.00495428;1.73058158;0.32864859;-0.12331526;1.38895531;0.80194698;-0.70576781;0.93858581;2.34687482;0.0124869;-0.42339452;2.1535986;0.88734299;-0.80289269;0.40426268;2.2888359;-0.22907384;-0.26897599;1.54588075;1.350909;-0.59548962;0.19248556;2.09446286;-0.0599024;-0.86764715;1.94053306;1.24092046;-1.21382899;0.28861945;1.45708077\", \"tag_4\": \"0.09601987;1.79091122;1.51241607;0.15140355;-0.22029392;0.35311483;2.01294182;0.74675243;-0.91219142;-0.11479409;1.471586;2.10590009;0.79785938;-0.51961445;-0.47316746;0.80397399;1.70220473;0.79817527;-0.8511636;-0.14538853;1.10266323;1.11418798;-0.05283848;-0.14234928;0.33590364;1.48447235;1.6688788;-0.64356563;-0.74619109;0.94730833\"}\n",
      "\n"
     ]
    }
   ],
   "source": [
    "with open('test_sequences.json', 'w') as outfile:\n",
    "  test_data_normal_string_list = labeled_test_mixed_sequences_array.tolist()[0:number_of_prediction_instances]\n",
    "  json_string = \"\"\n",
    "  for example in test_data_normal_string_list:\n",
    "    json_string += \"{\" + ','.join([\"{0}: \\\"{1}\\\"\".format('\\\"' + UNLABELED_CSV_COLUMNS[i] + '\\\"', example[i]) \n",
    "                                   for i in range(len(UNLABELED_CSV_COLUMNS))]) + \"}\\n\"\n",
    "  json_string = json_string.replace(' ', '').replace(':', ': ').replace(',', ', ')\n",
    "  print(json_string)\n",
    "  outfile.write(\"%s\" % json_string)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Dense Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_FEAT_ABS_RECON_ERR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           X_TIME_ABS_RECON_ERR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          FEAT_ANOM_FLAGS  MAHALANOBIS_DIST_FEAT                                                                                MAHALANOBIS_DIST_TIME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             TIME_ANOM_FLAGS\n",
      "[[0.66491856, 0.14611996, 0.93582327, 0.55496827, 0.09135211], [1.9797562239830313, 1.3783365022947291, 1.8716623922947293, 1.6653132422947292, 1.875927963983031], [1.75234653, 0.37882894, 2.07416534, 0.17487062, 0.97056041], [0.78400576, 0.21415584, 0.66961254, 0.14967874, 0.1594919], [0.75609776, 2.12791802, 0.45530108, 2.12154598, 0.62361487], [0.84197907, 0.0619942, 0.33779627, 0.98646297, 0.47084415], [1.533175501532634, 0.11572278, 1.29564858, 0.89614069, 2.416625801532634], [0.5140048703871729, 0.5855101998370751, 0.9384434398370751, 2.3510102198370753, 0.03613577038717297], [1.60418555, 0.6541758, 1.62194094, 1.48088977, 0.64437793], [0.16573821, 0.68204207, 0.50371325, 0.2009814, 0.18398029], [1.65752209, 1.56716207, 0.68795334, 0.7492661, 1.1087019], [2.179780678415666, 0.6482637519431376, 1.6206938119431376, 0.00827784805686238, 1.500852738415666], [0.65379731, 0.37778253, 1.67758936, 1.49459742, 0.45822295], [0.98907577, 1.57716806, 1.87901361, 0.78390433, 0.61682919], [0.85974301, 0.14216590938494233, 0.33606989061505765, 0.2644699506150576, 0.29801659], [1.281316293088751, 1.14077495, 1.15923235, 2.35191643, 2.749809053088751], [1.5099881341324441, 1.15195495, 0.39328089, 0.01970021, 1.2045267841324443], [1.28121539, 1.68996712, 1.03425895, 0.30345158, 0.41494366], [0.84517686, 0.81952461, 1.62499189, 1.84212884, 1.0210058], [0.35531630265161396, 1.0042604233989665, 0.3856308333989664, 1.2208532833989665, 1.736117902651614], [2.54710653, 1.21750258, 0.40736898, 1.26010881, 1.65998406], [0.07715313, 0.15392611, 1.1339056, 0.84082203, 1.83563618], [0.99222116, 0.18813038, 0.29514493, 2.33136081, 0.25813724], [0.14657169, 2.1498899, 1.74666228, 0.67124369, 0.13240912], [2.05595855, 0.22421678, 2.22234859, 0.70904769, 0.38837674], [1.8242911405854612, 1.7579665253925143, 0.7839624253925144, 0.03249214460748573, 1.3450046705854612], [0.53623582, 1.58292183, 0.7699364, 0.858758, 1.22683365], [0.75514892, 0.08034281, 0.64337751, 1.31116881, 0.4224495], [0.48173323, 0.51606627, 0.32518635, 0.49555797, 0.18025518], [2.3100255, 2.0111497, 1.48844008, 1.40730677, 0.08359485]]                            [[0.66491856, 0.14611996, 0.2823477639169991, 0.55496827, 0.09135211], [1.9145195, 1.91715205, 0.7703506539169991, 1.63017531, 2.01834776], [1.75234653, 0.37882894, 1.420689833916999, 0.17487062, 0.97056041], [0.78400576, 0.21415584, 0.016137033916999166, 0.14967874, 0.1594919], [0.75609776, 2.12791802, 1.108776586083001, 2.12154598, 0.62361487], [0.84197907, 0.0619942, 0.9912717760830009, 0.98646297, 0.47084415], [2.33069302, 0.11572278, 0.6421730739169991, 0.89614069, 1.44724272], [0.67758695, 1.93012199, 0.923713243916999, 0.16462197, 1.15545605], [1.60418555, 0.6541758, 0.9684654339169991, 1.48088977, 0.64437793], [0.16573821, 0.68204207, 1.1571887560830008, 0.2009814, 0.18398029], [1.65752209, 1.56716207, 1.3414288460830008, 0.7492661, 1.1087019], [1.38322258, 0.75419849, 0.8717070760830009, 1.41074009, 2.06215052], [0.65379731, 0.37778253, 1.0241138539169992, 1.49459742, 0.45822295], [0.98907577, 1.57716806, 1.225538103916999, 0.78390433, 0.61682919], [0.85974301, 1.37025903, 0.23854772391699908, 0.96362317, 0.29801659], [2.28947191, 1.14077495, 1.8127078560830008, 2.35191643, 0.82097915], [1.30827902, 1.15195495, 1.0467563960830009, 0.01970021, 1.61374037], [1.28121539, 1.68996712, 0.38078344391699903, 0.30345158, 0.41494366], [0.84517686, 0.81952461, 0.9715163839169991, 1.84212884, 1.0210058], [1.16128253, 0.85177925, 0.8169333339169991, 0.63518639, 0.21951907], [2.54710653, 1.21750258, 0.24610652608300088, 1.26010881, 1.65998406], [0.07715313, 0.15392611, 1.787381106083001, 0.84082203, 1.83563618], [0.99222116, 0.18813038, 0.9486204360830008, 2.33136081, 0.25813724], [0.14657169, 2.1498899, 1.0931867739169991, 0.67124369, 0.13240912], [2.05595855, 0.22421678, 1.5688730839169993, 0.70904769, 0.38837674], [1.51383899, 0.30835851, 0.012170083916999141, 1.48210016, 1.99312546], [0.53623582, 1.58292183, 1.4234119060830008, 0.858758, 1.22683365], [0.75514892, 0.08034281, 1.2968530160830007, 1.31116881, 0.4224495], [0.48173323, 0.51606627, 0.32828915608300085, 0.49555797, 0.18025518], [2.3100255, 2.0111497, 0.8349645739169991, 1.40730677, 0.08359485]]                     0                [5.310327868722802, 5.1684030989794945, 5.893782467876082, 6.386691992948246, 5.806938469748952]     [2.012306811059167, 2.860890933481071, 2.4222717449950584, 2.478509886741962, 3.118151705588298, 1.5449981606605214, 2.305554814484101, 2.3151505389860243, 0.9962263324486108, 1.962630750587889, 1.6026162289190038, 2.5088117041403164, 1.7206877325931833, 1.3631833688752497, 1.9847588113285144, 2.8955581132349564, 2.3337370926104066, 2.422448869625262, 1.893161588303851, 1.2859332536095562, 2.6604814944192205, 3.949840302240211, 2.8325757513149794, 2.757015275917138, 2.6999874751801083, 3.1437119781343044, 2.0038674045754954, 2.0179070576269194, 1.7771100863302298, 3.2572742844292715]    0\n",
      "[[0.17719106, 0.71030153, 0.09367139, 0.43296269, 0.587145], [1.529564563983031, 1.4285410522947293, 1.9580218122947293, 1.0653932622947293, 2.5407380539830315], [1.33668375, 0.09171495, 1.9004417, 0.48612455, 0.9576224], [0.4400062, 0.17981998, 0.21943487, 0.36227708, 0.12748192], [1.25963378, 2.22558183, 1.31156289, 1.45665627, 0.56293386], [1.73031706, 0.14653793, 0.09949706, 0.75931715, 0.94937899], [1.2786547715326342, 0.40682499, 1.15835086, 1.18570904, 2.3316647615326342], [1.078046150387173, 0.9574430598370751, 0.9795766798370751, 2.068787869837075, 0.008295850387172843], [1.11310486, 0.34023437, 1.30479204, 1.794074, 0.02936159], [0.32198926, 0.21518259, 0.15526542, 0.12783238, 0.10863562], [1.51152682, 1.86580895, 0.41549426, 0.99541007, 0.63922954], [1.4325045884156657, 0.5420050319431376, 1.3558560519431375, 0.6396969280568625, 2.066157088415666], [0.35512449, 0.6714036, 1.80027446, 1.53342289, 0.98793307], [1.27345835, 1.13412677, 2.14560549, 0.48745935, 0.64285446], [0.54471967, 0.3755658206150576, 0.1658399206150576, 0.3083235106150576, 0.54617024], [0.8740733030887511, 0.48981632, 0.38149954, 2.02896366, 2.029167853088751], [1.9509377441324443, 1.17631327, 0.43315075, 0.07280475, 1.2020017941324441], [1.24531881, 1.59408396, 0.65333784, 0.82926737, 0.67105137], [0.42520021, 0.78513187, 1.4824436, 1.65608629, 0.38921715], [0.07206511265161408, 0.7191697733989664, 0.8811370533989663, 1.2857441833989665, 1.032051892651614], [1.94324334, 1.7272055, 0.36708224, 0.96460788, 0.97877305], [0.40487656, 0.03057556, 1.01950586, 0.66030174, 1.24861088], [1.015864, 0.53859453, 0.18231947, 1.88675877, 0.1069746], [0.25622177, 1.69313548, 1.00474388, 0.30225988, 0.6347279], [1.77878128, 0.226495, 2.17614239, 0.12357446, 0.04215181], [1.767678110585461, 1.5535439453925144, 0.5965079853925144, 0.6210154646074857, 2.076293440585461], [0.79358892, 1.44571603, 0.94154304, 0.66685794, 1.56819848], [1.3590808, 0.07160673, 0.97572663, 0.56192636, 0.32655155], [0.73755601, 0.73000503, 0.2814986, 0.92809804, 0.10546471], [2.62965859, 1.86491928, 2.11980224, 1.80654295, 0.3429311]]                                   [[0.17719106, 0.71030153, 0.5598041160830008, 0.43296269, 0.587145], [2.36471116, 1.8669475, 0.6839912339169991, 2.23009529, 1.35353767], [1.33668375, 0.09171495, 1.2469661939169991, 0.48612455, 0.9576224], [0.4400062, 0.17981998, 0.8729103760830008, 0.36227708, 0.12748192], [1.25963378, 2.22558183, 1.965038396083001, 1.45665627, 0.56293386], [1.73031706, 0.14653793, 0.5539784460830008, 0.75931715, 0.94937899], [2.58521375, 0.40682499, 0.5048753539169992, 1.18570904, 1.53220376], [0.11354567, 1.55818913, 0.8825800039169991, 0.44684432, 1.18329597], [1.11310486, 0.34023437, 0.6513165339169991, 1.794074, 0.02936159], [0.32198926, 0.21518259, 0.4982100860830009, 0.12783238, 0.10863562], [1.51152682, 1.86580895, 1.0689697660830009, 0.99541007, 0.63922954], [2.13049867, 0.86045721, 0.6068693160830009, 2.04215917, 1.49684617], [0.35512449, 0.6714036, 1.1467989539169992, 1.53342289, 0.98793307], [1.27345835, 1.13412677, 1.492129983916999, 0.48745935, 0.64285446], [0.54471967, 0.8525273, 0.40877769391699914, 0.91976961, 0.54617024], [2.6967149, 0.48981632, 1.034975046083001, 2.02896366, 1.54162035], [0.86732941, 1.17631327, 1.086626256083001, 0.07280475, 1.61626536], [1.24531881, 1.59408396, 0.0001376660830009202, 0.82926737, 0.67105137], [0.42520021, 0.78513187, 0.8289680939169992, 1.65608629, 0.38921715], [1.44453372, 1.1368699, 0.3214271139169992, 0.57029549, 0.48454694], [1.94324334, 1.7272055, 1.0205577460830009, 0.96460788, 0.97877305], [0.40487656, 0.03057556, 1.6729813660830009, 0.66030174, 1.24861088], [1.015864, 0.53859453, 0.47115603608300083, 1.88675877, 0.1069746], [0.25622177, 1.69313548, 0.35126837391699905, 0.30225988, 0.6347279], [1.77878128, 0.226495, 1.522666883916999, 0.12357446, 0.04215181], [1.57045202, 0.10393593, 0.19962452391699914, 2.07062348, 1.26183669], [0.79358892, 1.44571603, 1.5950185460830009, 0.66685794, 1.56819848], [1.3590808, 0.07160673, 1.629202136083001, 0.56192636, 0.32655155], [0.73755601, 0.73000503, 0.3719769060830009, 0.92809804, 0.10546471], [2.62965859, 1.86491928, 1.466326733916999, 1.80654295, 0.3429311]]                              0                [5.301400583750674, 4.530613840187373, 6.259841285334715, 5.313381265181372, 5.300890337674121]      [1.6300873640977824, 2.866236462506482, 1.9235026574743503, 1.9110098676586937, 3.0030527908165383, 1.6234412598548669, 2.352278073783202, 2.2456428089204166, 2.173057216169791, 2.1444006072752897, 1.7935471319582255, 2.143933664826338, 2.159993944797905, 1.6161994279183, 1.3833489439378164, 2.445821589769166, 2.3127365912819493, 2.435283625443268, 2.001753363097299, 1.793438194044808, 1.7735032985899954, 2.963905781672833, 2.2586008794702006, 2.388719769877055, 3.2462129056428974, 2.6499088684177945, 2.303512110020294, 2.5606838439890223, 1.6388662795852067, 3.23282753240765]           0\n",
      "[[0.56407532, 0.99841597, 0.79596068, 0.56405834, 0.94153508], [1.6769202339830311, 1.4188846522947292, 1.5101395622947293, 0.9559216522947294, 1.9732365239830312], [1.48425456, 0.67996731, 1.18440192, 0.01928487, 1.23240201], [0.4582741, 0.36469926, 0.6851619, 0.88295555, 0.19354849], [0.74001439, 2.02594307, 0.51180857, 1.38164722, 0.02721869], [1.17780382, 0.40838761, 0.64516618, 0.93342287, 0.32052958], [1.351570631532634, 0.70422727, 0.859677, 0.98667119, 2.650255921532634], [0.37867960038717297, 0.909217539837075, 0.698205619837075, 1.820308439837075, 0.833264770387173], [0.89756718, 0.30621662, 1.00894047, 2.16844925, 0.82980208], [0.04710926, 0.59939678, 0.02323468, 0.19033075, 0.09731961], [2.26889544, 1.82428969, 1.32522709, 0.12080565, 1.41645797], [1.4744357184156658, 0.6528178819431376, 0.8048087019431376, 0.07449399805686241, 1.5915912084156658], [0.34440918, 0.19356367, 1.22555665, 1.2454856, 0.18904187], [1.26350166, 1.11676055, 2.10937369, 0.64102547, 0.98276332], [0.82788279, 0.2286996093849425, 0.2949636106150576, 0.6263881506150576, 0.59979095], [1.1576799130887512, 0.30363095, 0.93750619, 2.33863214, 1.952883713088751], [1.9468958541324444, 0.88551093, 0.21586528, 0.07862161, 1.5896767941324441], [0.77068466, 1.61644233, 1.09578856, 0.53523123, 0.19796442], [1.29778275, 0.86644429, 1.76662781, 1.59156042, 1.08586748], [0.0007284273483860737, 1.2137183333989663, 0.5177946033989664, 0.45060202339896627, 1.409419582651614], [2.08484064, 1.86929387, 0.38463941, 1.21651573, 1.10829904], [0.11026772, 0.56763947, 0.40313816, 0.86007653, 1.60354724], [0.93499246, 0.28351136, 0.51195442, 2.3446296, 0.37362338], [0.31454002, 1.2989801, 1.69684109, 0.14265097, 0.61213502], [2.03869059, 0.07792312, 2.37203636, 0.55523953, 0.10515549], [1.1647501305854613, 1.2424465453925144, 0.27005612539251445, 0.2185117746074856, 1.6287941705854612], [0.02256827, 1.3108805, 0.94215326, 0.8424894, 0.97441548], [0.76568536, 0.35569196, 0.77441587, 0.59742515, 0.11367894], [0.223173, 0.83411026, 0.14614711, 1.12757917, 0.55315244], [2.41177806, 2.03297332, 1.85351877, 2.20907267, 0.41229579]]                       [[0.56407532, 0.99841597, 0.1424851739169991, 0.56405834, 0.94153508], [2.21735549, 1.8766039, 1.131873483916999, 2.3395669, 1.9210392], [1.48425456, 0.67996731, 0.5309264139169991, 0.01928487, 1.23240201], [0.4582741, 0.36469926, 0.03168639391699912, 0.88295555, 0.19354849], [0.74001439, 2.02594307, 1.165284076083001, 1.38164722, 0.02721869], [1.17780382, 0.40838761, 1.298641686083001, 0.93342287, 0.32052958], [2.51229789, 0.70422727, 0.20620149391699916, 0.98667119, 1.2136126], [0.81291222, 1.60641465, 1.1639510639169992, 0.69532375, 0.35832705], [0.89756718, 0.30621662, 0.3554649639169991, 2.16844925, 0.82980208], [0.04710926, 0.59939678, 0.6767101860830008, 0.19033075, 0.09731961], [2.26889544, 1.82428969, 1.978702596083001, 0.12080565, 1.41645797], [2.08856754, 0.74964436, 0.05582196608300083, 1.47695624, 1.97141205], [0.34440918, 0.19356367, 0.572081143916999, 1.2454856, 0.18904187], [1.26350166, 1.11676055, 1.455898183916999, 0.64102547, 0.98276332], [0.82788279, 1.45679273, 0.2796540039169991, 0.60170497, 0.59979095], [2.41310829, 0.30363095, 1.5909816960830008, 2.33863214, 1.61790449], [0.8713713, 0.88551093, 0.8693407860830009, 0.07862161, 1.22859036], [0.77068466, 1.61644233, 0.44231305391699904, 0.53523123, 0.19796442], [1.29778275, 0.86644429, 1.113152303916999, 1.59156042, 1.08586748], [1.51732726, 0.64232134, 0.6847695639169991, 1.40543765, 0.10717925], [2.08484064, 1.86929387, 0.26883609608300085, 1.21651573, 1.10829904], [0.11026772, 0.56763947, 1.0566136660830008, 0.86007653, 1.60354724], [0.93499246, 0.28351136, 1.165429926083001, 2.3446296, 0.37362338], [0.31454002, 1.2989801, 1.043365583916999, 0.14265097, 0.61213502], [2.03869059, 0.07792312, 1.7185608539169992, 0.55523953, 0.10515549], [2.17338, 0.20716147, 0.5260763839169991, 1.66811979, 1.70933596], [0.02256827, 1.3108805, 1.5956287660830009, 0.8424894, 0.97441548], [0.76568536, 0.35569196, 1.427891376083001, 0.59742515, 0.11367894], [0.223173, 0.83411026, 0.5073283960830008, 1.12757917, 0.55315244], [2.41177806, 2.03297332, 1.2000432639169991, 2.20907267, 0.41229579]]                               0                [5.3056826121769465, 5.3477533653224425, 5.964002278474087, 5.3034019052039945, 6.223511588235698]   [1.9469519477056227, 3.149087887727545, 2.161037707205246, 2.1826808284800916, 2.6764525949642426, 1.5254688026055996, 2.428703985211679, 1.6279809006341355, 2.672170221184522, 2.0091525467229623, 3.574053215750909, 2.9120042637535644, 2.0298238928278898, 1.3448098889599718, 1.8801240520100606, 3.077086793527396, 1.7777405261737431, 2.1483617185268993, 1.185424761783685, 1.6764066349318987, 2.6198854499116355, 2.773766856563607, 2.854159209647521, 1.7506576177400264, 3.353281663268994, 2.395051280776188, 2.4337124036298063, 2.056316494142215, 1.7781539084126672, 3.265916434244933]       0\n",
      "[[0.42126312, 0.83495192, 0.76809582, 0.72446044, 0.74212608], [1.9781436739830311, 1.5690596922947293, 1.4019729822947293, 1.5057226522947293, 2.2936211639830315], [1.15577886, 0.69048477, 1.68027055, 0.5995043, 1.44689852], [0.51229836, 0.15195203, 0.01449823, 0.29050033, 0.20538241], [0.56412723, 1.81144859, 0.76833814, 1.59976153, 0.23862303], [1.78292241, 0.42598887, 0.06323329, 1.55619488, 0.98306409], [1.898306621532634, 0.62738702, 0.81700795, 1.07504783, 1.7751784715326342], [0.5786503603871729, 0.596844249837075, 0.4496199098370752, 1.746206129837075, 0.47823518038717294], [0.84437795, 0.08209937, 1.52797847, 1.73877153, 0.36451671], [0.21312217, 0.88814676, 0.15271752, 0.04319877, 0.05793743], [1.74664349, 1.3766724, 1.09156426, 0.65155011, 0.59341791], [1.6794778184156658, 0.6749013619431377, 1.3538851819431377, 0.012687268056862377, 2.068671788415666], [0.5116456, 1.15848756, 1.9033371, 1.23854522, 0.56347407], [1.02126818, 1.37880414, 1.51497711, 0.7096767, 0.22791291], [0.73948334, 0.3620234706150576, 0.7140699106150576, 0.49983353061505764, 0.30649144], [1.047407243088751, 0.77535041, 0.62353928, 1.60513711, 2.1663201030887507], [2.0741381141324444, 0.67921471, 0.75683717, 0.2605117, 1.6235854941324441], [1.35536017, 0.83980365, 0.47646536, 0.88187029, 0.0759247], [0.59437695, 0.41557283, 2.1032838, 1.82338286, 0.24974403], [0.07115923265161395, 0.6979215633989664, 0.33507977339896633, 0.4187005833989663, 1.886595592651614], [2.2661811, 1.14488711, 0.29563802, 0.97684025, 1.50435203], [0.77992007, 0.68099151, 1.08365054, 0.22276613, 1.43292034], [1.22885127, 0.56917152, 0.19123748, 2.16613619, 0.23921067], [0.45589788, 1.51629663, 0.84269981, 0.43187756, 1.09305809], [1.96042996, 0.74655844, 2.34527762, 0.96124318, 0.08724514], [1.6135998205854611, 1.8004073753925143, 0.5600128253925144, 0.3771000046074857, 1.532588000585461], [0.42378919, 2.04346636, 0.15693771, 1.21815652, 1.56683133], [1.14939038, 0.01299723, 1.08716567, 1.15328814, 0.04704193], [0.95947915, 0.70726465, 0.32190664, 1.09508608, 0.66817036], [2.21788557, 1.65701281, 1.89654211, 1.35338326, 0.43310227]]                     [[0.42126312, 0.83495192, 0.11462031391699912, 0.72446044, 0.74212608], [1.91613205, 1.72642886, 1.240040063916999, 1.7897659, 1.60065456], [1.15577886, 0.69048477, 1.026795043916999, 0.5995043, 1.44689852], [0.51229836, 0.15195203, 0.6679737360830009, 0.29050033, 0.20538241], [0.56412723, 1.81144859, 1.4218136460830009, 1.59976153, 0.23862303], [1.78292241, 0.42598887, 0.5902422160830009, 1.55619488, 0.98306409], [1.9655619, 0.62738702, 0.16353244391699917, 1.07504783, 2.08869005], [0.61294146, 1.91878794, 1.412536773916999, 0.76942606, 0.71335664], [0.84437795, 0.08209937, 0.8745029639169992, 1.73877153, 0.36451671], [0.21312217, 0.88814676, 0.5007579860830009, 0.04319877, 0.05793743], [1.74664349, 1.3766724, 1.7450397660830008, 0.65155011, 0.59341791], [1.88352544, 0.72756088, 0.6048984460830009, 1.41514951, 1.49433147], [0.5116456, 1.15848756, 1.249861593916999, 1.23854522, 0.56347407], [1.02126818, 1.37880414, 0.8615016039169991, 0.7096767, 0.22791291], [0.73948334, 0.86606965, 0.13945229608300092, 0.72825959, 0.30649144], [2.52338096, 0.77535041, 1.2770147860830008, 1.60513711, 1.4044681], [0.74412904, 0.67921471, 1.410312676083001, 0.2605117, 1.19468166], [1.35536017, 0.83980365, 0.17701014608300086, 0.88187029, 0.0759247], [0.59437695, 0.41557283, 1.449808293916999, 1.82338286, 0.24974403], [1.4454396, 1.15811811, 0.8674843939169992, 1.43733909, 0.36999676], [2.2661811, 1.14488711, 0.9491135260830008, 0.97684025, 1.50435203], [0.77992007, 0.68099151, 1.737126046083001, 0.22276613, 1.43292034], [1.22885127, 0.56917152, 0.4622380260830009, 2.16613619, 0.23921067], [0.45589788, 1.51629663, 0.18922430391699918, 0.43187756, 1.09305809], [1.96042996, 0.74655844, 1.6918021139169992, 0.96124318, 0.08724514], [1.72453031, 0.35079936, 0.2361196839169991, 1.82670802, 1.80554213], [0.42378919, 2.04346636, 0.8104132160830009, 1.21815652, 1.56683133], [1.14939038, 0.01299723, 1.740641176083001, 1.15328814, 0.04704193], [0.95947915, 0.70726465, 0.33156886608300085, 1.09508608, 0.66817036], [2.21788557, 1.65701281, 1.243066603916999, 1.35338326, 0.43310227]]                        0                [4.966577772403866, 5.512047451008698, 4.706090042694455, 5.601618523472329, 5.364458670005386]      [1.9398516766584555, 2.226460200842519, 1.5291399286590526, 1.8836866121803468, 2.600982528230734, 1.353039775791455, 2.91187847101982, 2.04233927828744, 2.1118018937644303, 2.139739490740902, 2.2822014580458885, 1.5840368251381163, 1.534345028053275, 1.4966253224023744, 1.8110456715379384, 2.006741034297602, 1.9826261224321027, 2.085490249169162, 2.581596241224522, 1.3207647198758732, 1.8040631786113734, 2.6623222765545287, 2.4630711544288597, 2.416994649717971, 2.706976581163489, 2.7627835894038153, 2.9532755259261396, 2.819481305330222, 1.242317853192571, 2.3538640847227104]          0\n",
      "[[0.72579761, 0.28667536, 0.90848602, 0.95364124, 0.40835687], [1.4190504139830313, 1.9107417422947293, 1.0787261322947295, 1.5581936922947293, 2.328893953983031], [1.327882, 0.65711262, 1.85921972, 0.46975947, 1.37825225], [0.75268684, 0.24981812, 0.24197257, 0.60177623, 0.08545293], [1.1781596, 1.58942549, 0.9100976, 1.60340907, 0.70862794], [1.8190688, 0.16474207, 0.00275013, 1.05856077, 0.88269748], [1.1066589115326342, 0.61395175, 1.00053774, 1.1101516, 2.701051611532634], [0.830962910387173, 1.0169449398370751, 1.115072909837075, 2.0591773698370752, 0.11429294038717286], [0.83751352, 0.45787859, 0.74702449, 2.09716668, 0.90948711], [0.71114497, 0.41612629, 0.50267597, 0.21975787, 0.60861432], [1.94022901, 1.41471588, 0.84651481, 0.38319073, 1.48940031], [1.9016898184156659, 0.9889726619431376, 1.1731748419431376, 0.6502422280568625, 1.522636778415666], [0.31676063, 0.80739775, 1.98407809, 1.16664725, 0.14156203], [0.97258012, 1.49833563, 2.26690591, 1.21537023, 0.44991055], [0.64972194, 0.2595708193849424, 0.32583902061505765, 0.9698263706150576, 0.2542472], [0.9372258930887511, 0.45534772, 1.13558066, 2.25034501, 2.198472313088751], [1.8107577241324442, 0.70898202, 0.21949626, 0.60087805, 1.0192348741324442], [1.47431186, 0.98323878, 1.04933645, 0.49597547, 0.09845316], [0.72892581, 0.74497386, 1.6770574, 1.33748965, 0.64955625], [0.01474676265161401, 1.2071215033989664, 0.30396373339896643, 0.42671916339896643, 1.1901173726516139], [2.21181981, 1.63324152, 0.14044969, 0.60206741, 1.18872066], [0.2661509, 0.03950937, 0.86823706, 1.00846474, 1.24506551], [1.25935447, 0.05579431, 0.28564309, 1.58231814, 0.0067401], [0.30660896, 1.54732627, 1.74831191, 0.5112769, 0.50290517], [1.88079632, 0.66710993, 1.70918509, 0.98310747, 0.33286966], [1.7182766505854612, 1.8007486653925144, 0.32952665539251447, 0.4269217346074856, 1.904028660585461], [0.05001294, 1.53111315, 0.04343257, 0.88289004, 1.71245797], [0.84116216, 0.01973695, 0.9626134, 1.03286975, 0.58743568], [0.34933468, 0.37731297, 0.09400303, 0.93315793, 0.95471011], [2.13577794, 1.75623545, 2.07010619, 2.15740461, 0.93948165]]                        [[0.72579761, 0.28667536, 0.25501051391699914, 0.95364124, 0.40835687], [2.47522531, 1.38474681, 1.563286913916999, 1.73729486, 1.56538177], [1.327882, 0.65711262, 1.2057442139169992, 0.46975947, 1.37825225], [0.75268684, 0.24981812, 0.8954480760830008, 0.60177623, 0.08545293], [1.1781596, 1.58942549, 1.563573106083001, 1.60340907, 0.70862794], [1.8190688, 0.16474207, 0.6507253760830009, 1.05856077, 0.88269748], [2.75720961, 0.61395175, 0.3470622339169991, 1.1101516, 1.16281691], [0.36062891, 1.49868725, 0.7470837739169991, 0.45645482, 1.07729888], [0.83751352, 0.45787859, 0.09354898391699917, 2.09716668, 0.90948711], [0.71114497, 0.41612629, 1.156151476083001, 0.21975787, 0.60861432], [1.94022901, 1.41471588, 1.4999903160830008, 0.38319073, 1.48940031], [1.66131344, 0.41348958, 0.42418810608300084, 2.05270447, 2.04036648], [0.31676063, 0.80739775, 1.330602583916999, 1.16664725, 0.14156203], [0.97258012, 1.49833563, 1.6134304039169993, 1.21537023, 0.44991055], [0.64972194, 1.48766394, 0.24877859391699908, 0.25826675, 0.2542472], [2.63356231, 0.45534772, 1.7890561660830009, 2.25034501, 1.37231589], [1.00750943, 0.70898202, 0.8729717660830009, 0.60087805, 1.79903228], [1.47431186, 0.98323878, 0.3958609439169991, 0.49597547, 0.09845316], [0.72892581, 0.74497386, 1.0235818939169992, 1.33748965, 0.64955625], [1.50185207, 0.64891817, 0.8986004339169991, 1.42932051, 0.32648146], [2.21181981, 1.63324152, 0.7939251960830008, 0.60206741, 1.18872066], [0.2661509, 0.03950937, 1.5217125660830009, 1.00846474, 1.24506551], [1.25935447, 0.05579431, 0.9391185960830009, 1.58231814, 0.0067401], [0.30660896, 1.54732627, 1.094836403916999, 0.5112769, 0.50290517], [1.88079632, 0.66710993, 1.0557095839169992, 0.98310747, 0.33286966], [1.61985348, 0.35114065, 0.46660585391699905, 1.87652975, 1.43410147], [0.05001294, 1.53111315, 0.6969080760830009, 0.88289004, 1.71245797], [0.84116216, 0.01973695, 1.6160889060830008, 1.03286975, 0.58743568], [0.34933468, 0.37731297, 0.7474785360830009, 0.93315793, 0.95471011], [2.13577794, 1.75623545, 1.4166306839169993, 2.15740461, 0.93948165]]                   0                [5.423262321520451, 4.347602410351017, 6.03279570280449, 4.778187546666035, 5.870953317280602]       [1.6671804521200801, 2.3721198817819285, 1.6684059677422982, 1.6905976589077287, 1.9588121957717566, 1.4549324851677055, 2.5225936235253115, 1.8868987077211583, 2.8502534424323898, 1.6733395899319317, 2.3902546189432896, 3.125181978585644, 1.979485881217362, 1.8896609995791762, 2.342411114950014, 3.0814292738262403, 2.184007393329681, 2.143959969756866, 1.1771649996323181, 1.2843792587980998, 2.2815062258217456, 2.9310799983283697, 2.193228784658754, 1.749988879658502, 1.6538666318586106, 2.1692576974729185, 3.070085369711097, 2.3384736931056134, 1.7261933738233566, 2.5256461058581685]  0\n",
      "[[0.32586937, 0.88830138, 0.81516693, 0.4737608, 0.69678881], [1.8094372339830311, 1.8878636922947292, 1.6903627422947292, 1.5630407122947292, 2.7154226539830315], [1.75075176, 0.89037037, 1.6907453, 0.23163436, 1.44638281], [1.3336731, 0.24249388, 0.22479972, 0.9631771, 0.70780262], [1.17097551, 1.91719852, 0.95582798, 1.49774874, 0.62696339], [0.97406564, 0.01578304, 0.27743592, 1.58665541, 0.36653819], [2.075095121532634, 0.08442717, 0.69123689, 0.44556445, 1.940178461532634], [1.111480030387173, 0.9592543098370749, 0.3370465198370751, 2.168250529837075, 0.4888806103871729], [1.08188674, 0.12647233, 1.0722736, 1.59298496, 0.29447236], [0.05479934, 0.38200814, 0.30677606, 0.15497374, 0.28310942], [1.99891319, 1.6873275, 0.75284401, 0.79636535, 0.85425089], [1.9516645484156658, 0.4157706119431376, 1.7448936519431375, 0.20345640805686238, 1.613888698415666], [0.71490799, 1.14192299, 1.70903897, 1.12169701, 0.38299738], [0.99111498, 1.31623504, 1.86075445, 0.64230298, 0.96769782], [0.87641865, 0.6935228406150576, 0.15183666061505763, 0.8473605606150576, 0.15079265], [0.9512729830887512, 0.55379481, 0.75971642, 2.18393302, 2.065396793088751], [2.0045820741324443, 1.41801087, 1.11335946, 0.50269062, 1.6573857541324442], [0.72022372, 1.68637843, 0.37604343, 0.95453435, 0.6075995], [1.31567318, 0.93578977, 1.86715537, 1.19402396, 0.87810787], [0.532447002651614, 0.9152531933989664, 0.7604112833989665, 0.5946724633989664, 1.759312412651614], [1.75673683, 1.1668302, 0.33711711, 1.40427224, 1.14046976], [0.24764211, 0.32543639, 1.36609983, 0.98199957, 1.12508366], [1.37138841, 0.656733, 0.22295621, 1.47015842, 0.35562226], [0.00938338, 1.68649731, 0.90491489, 0.17585038, 0.1424098], [2.49622452, 0.12277812, 1.75689099, 0.28801113, 0.17615414], [1.4045204705854613, 1.1553025353925144, 0.5278465653925144, 0.20131496539251437, 1.646265990585461], [0.8683438, 1.32494733, 0.77558837, 1.12020913, 0.92168567], [1.02346433, 0.39247261, 1.15932892, 1.40855673, 0.31295013], [0.22796142, 0.66217234, 0.60134914, 0.51226752, 0.44942316], [2.17651303, 1.33253825, 1.8090888, 2.27812881, 0.15731019]]                              [[0.32586937, 0.88830138, 0.1616914239169991, 0.4737608, 0.69678881], [2.08483849, 1.40762486, 0.9516503039169992, 1.73244784, 1.17885307], [1.75075176, 0.89037037, 1.037269793916999, 0.23163436, 1.44638281], [1.3336731, 0.24249388, 0.42867578608300083, 0.9631771, 0.70780262], [1.17097551, 1.91719852, 1.609303486083001, 1.49774874, 0.62696339], [0.97406564, 0.01578304, 0.9309114260830009, 1.58665541, 0.36653819], [1.7887734, 0.08442717, 0.037761383916999125, 0.44556445, 1.92369006], [0.08011179, 1.55637788, 1.525110163916999, 0.34738166, 0.70271121], [1.08188674, 0.12647233, 0.41879809391699907, 1.59298496, 0.29447236], [0.05479934, 0.38200814, 0.9602515660830009, 0.15497374, 0.28310942], [1.99891319, 1.6873275, 1.4063195160830009, 0.79636535, 0.85425089], [1.61133871, 0.98669163, 0.9959069160830009, 1.60591865, 1.94911456], [0.71490799, 1.14192299, 1.055563463916999, 1.12169701, 0.38299738], [0.99111498, 1.31623504, 1.207278943916999, 0.64230298, 0.96769782], [0.87641865, 0.53457028, 0.4227809539169991, 0.38073256, 0.15079265], [2.61951522, 0.55379481, 1.4131919260830008, 2.18393302, 1.50539141], [0.81368508, 1.41801087, 1.766834966083001, 0.50269062, 1.1608814], [0.72022372, 1.68637843, 0.27743207608300086, 0.95453435, 0.6075995], [1.31567318, 0.93578977, 1.2136798639169992, 1.19402396, 0.87810787], [0.98415183, 0.94078648, 0.44215288391699903, 1.26136721, 0.24271358], [1.75673683, 1.1668302, 0.9905926160830009, 1.40427224, 1.14046976], [0.24764211, 0.32543639, 2.019575336083001, 0.98199957, 1.12508366], [1.37138841, 0.656733, 0.8764317160830009, 1.47015842, 0.35562226], [0.00938338, 1.68649731, 0.25143938391699916, 0.17585038, 0.1424098], [2.49622452, 0.12277812, 1.1034154839169992, 0.28801113, 0.17615414], [1.93360966, 0.29430548, 0.2682859439169991, 1.24829305, 1.69186414], [0.8683438, 1.32494733, 1.429063876083001, 1.12020913, 0.92168567], [1.02346433, 0.39247261, 1.812804426083001, 1.40855673, 0.31295013], [0.22796142, 0.66217234, 0.05212636608300092, 0.51226752, 0.44942316], [2.17651303, 1.33253825, 1.1556132939169992, 2.27812881, 0.15731019]]                       0                [6.31521147138998, 5.537516370451984, 5.386881933548947, 5.814958037157559, 5.82719988592448]        [1.9715411006776264, 1.6740221665089643, 2.055105094316968, 1.2895787618693375, 2.276362051620826, 1.9518941669935002, 3.2544231720223022, 2.3067924225828755, 1.961977034301487, 2.0534213055329666, 2.0756749845498264, 2.2649579529219768, 1.1933333965672512, 1.1081031860981845, 1.7443938098627525, 2.6454493915168675, 2.17715074522906, 2.1622632363692014, 0.6915413578613918, 1.5243799547462777, 1.007235589340326, 3.261457369491263, 1.2224090325621593, 2.826667864891164, 3.479853791326583, 2.3491979499080062, 1.3941254366212779, 2.486795308660907, 2.1585788955555816, 2.895847254625157]     0\n",
      "[[0.51050055, 0.32816545, 0.17517288, 0.9398891, 0.88440641], [0.6015927722947292, 1.2638051422947294, 1.2401361522947294, 1.1487204222947294, 1.4519692222947294], [1.25894302, 0.50770387, 1.44003648, 0.31705662, 1.2522011], [0.77298241, 0.09223325, 0.517610212, 0.75858031, 0.04731375], [0.89719575, 2.18201483, 1.12973153, 1.87535511, 0.24563516], [1.24131578, 0.57779839, 0.441912631, 1.10697737, 0.93245825], [2.43433832, 0.68059114, 0.945471325, 1.38074992, 1.34810386], [1.816657209837075, 0.6913048798370751, 1.013915369837075, 1.608474719837075, 1.350332149837075], [1.42118052, 0.11727799, 1.12132048, 1.98787289, 0.82167278], [0.23639712, 0.4752929, 0.379924419, 0.53331953, 0.30757919], [2.10150457, 1.13392897, 0.897876304, 0.162247, 0.98430533], [0.029456501943137647, 0.6731288319431377, 1.0819711389431377, 0.4475886780568623, 0.15874963805686249], [0.73292098, 0.58817182, 2.012083, 1.25558865, 0.45867778], [1.04882182, 1.24613585, 1.56316061, 0.44769547, 0.13653135], [0.5785110606150576, 0.08701862938494243, 0.8096913186150576, 0.17759989061505754, 1.6089884406150576], [2.15595112, 0.62279865, 0.236201103, 1.38079449, 0.94985839], [1.27492057, 0.74081665, 0.405905271, 0.25674551, 1.74326557], [0.58570506, 1.27299271, 0.967094333, 0.09597546, 0.52395315], [1.15496434, 1.08821874, 1.47189522, 1.25296602, 0.72746284], [0.8990959733989664, 1.1467493433989664, 0.18522826339896636, 0.9457473833989664, 1.6427156533989664], [1.84614769, 1.07553303, 0.0283967475, 1.3604584, 1.81347259], [7.2838498, 0.55135701, 14.9912774, 6.87075078, 22.50918043], [28.68679059, 0.59198618, 2.50368069, 30.16100196, 2.03767266], [3.68852023, 28.72731254, 13.9946933, 13.73234042, 9.76303956], [41.20186049, 8.63084852, 29.8725861, 9.54641123, 4.53970771], [24.344480014607488, 5.966338005392514, 27.476278915392513, 16.408895085392516, 17.209383054607486], [4.07374501, 28.62139419, 6.78922731, 13.17329063, 23.85139048], [18.21477023, 6.26020798, 9.22078879, 11.59449353, 4.29725835], [7.88766113, 3.07549138, 11.2866692, 8.69392126, 10.15250383], [31.413113, 21.37796897, 33.4847886, 19.89690794, 4.12923311]]                            [[0.51050055, 0.32816545, 0.4783026260830009, 0.9398891, 0.88440641], [2.69389578, 2.03168341, 1.401876893916999, 2.14676813, 1.84351933], [1.25894302, 0.50770387, 0.7865609739169992, 0.31705662, 1.2522011], [0.77298241, 0.09223325, 0.13586529408300085, 0.75858031, 0.04731375], [0.89719575, 2.18201483, 1.7832070360830008, 1.87535511, 0.24563516], [1.24131578, 0.57779839, 1.0953881370830008, 1.10697737, 0.93245825], [2.43433832, 0.68059114, 0.2919958189169991, 1.38074992, 1.34810386], [0.69897498, 1.82432731, 0.8482413139169991, 0.90715747, 1.16530004], [1.42118052, 0.11727799, 0.4678449739169992, 1.98787289, 0.82167278], [0.23639712, 0.4752929, 1.0333999250830008, 0.53331953, 0.30757919], [2.10150457, 1.13392897, 1.5513518100830008, 0.162247, 0.98430533], [1.37300574, 0.72933341, 0.33298440308300087, 1.85005092, 1.56121188], [0.73292098, 0.58817182, 1.3586074939169992, 1.25558865, 0.45867778], [1.04882182, 1.24613585, 0.9096851039169991, 0.44769547, 0.13653135], [0.64958206, 1.31511175, 0.23507370408300088, 1.05049323, 0.38089532], [2.15595112, 0.62279865, 0.8896766090830008, 1.38079449, 0.94985839], [1.27492057, 0.74081665, 1.0593807770830008, 0.25674551, 1.74326557], [0.58570506, 1.27299271, 0.31361882691699916, 0.09597546, 0.52395315], [1.15496434, 1.08821874, 0.8184197139169991, 1.25296602, 0.72746284], [0.9569437, 0.70929033, 1.0173359039169991, 0.91029229, 0.21332402], [1.84614769, 1.07553303, 0.6818722535830009, 1.3604584, 1.81347259], [7.2838498, 0.55135701, 15.644752906083001, 6.87075078, 22.50918043], [28.68679059, 0.59198618, 1.850205183916999, 30.16100196, 2.03767266], [3.68852023, 28.72731254, 13.341217793916998, 13.73234042, 9.76303956], [41.20186049, 8.63084852, 30.526061606083, 9.54641123, 4.53970771], [25.79408803, 4.51672999, 26.680146406083, 14.95928707, 18.65899107], [4.07374501, 28.62139419, 6.135751803917, 13.17329063, 23.85139048], [18.21477023, 6.26020798, 9.874264296083002, 11.59449353, 4.29725835], [7.88766113, 3.07549138, 10.633193693916999, 8.69392126, 10.15250383], [31.413113, 21.37796897, 32.831313093917004, 19.89690794, 4.12923311]]           1                [199.4148860798803, 149.1666721036442, 182.3867462059805, 159.31288973700202, 130.8934540273474]     [1.6415401315127278, 3.2075582712371964, 1.632448993105854, 2.182801876563996, 3.3164187952496493, 0.7611665098329774, 2.178026614831826, 1.9265043735405996, 2.1517440178530203, 1.6704439534151676, 2.6811001093189044, 2.386756010680197, 1.5786453300791474, 1.7052824287042467, 1.9735403616438332, 1.3411767861784343, 2.280201066585624, 2.0768618108987007, 0.6715039100435288, 1.1568892059650056, 1.983166968802266, 49.79701844409846, 52.40383421346264, 53.2506332907376, 81.57704779485424, 64.51893430695992, 62.54691780793628, 30.58669154246498, 26.92430947721573, 80.23821138364197]          1\n",
      "[[0.29132869, 0.8557475, 0.5217148, 0.47092471, 0.116552148], [1.3473691822947294, 1.9606719539830313, 1.1984554322947294, 1.8045846722947292, 2.416301133983031], [1.7276976, 0.31294082, 1.31606867, 0.13276539, 1.21258438], [0.60992108, 0.44979634, 0.26721771, 0.14971593, 0.0230026774], [1.26241941, 1.25960367, 0.99434981, 1.70488311, 0.720304694], [1.47374999, 0.2857751, 0.03704256, 1.54542686, 0.300584391], [2.36994795, 4.564327711532634, 1.42266911, 1.15809336, 1.7523720115326342], [2.3366367898370752, 0.20432750961282697, 0.9710113898370751, 2.430529879837075, 0.058853889612827004], [1.17736161, 0.13365899, 0.77225229, 1.88856105, 0.21527211], [0.46428297, 0.8439945, 0.2169492, 0.49502568, 0.63643186], [2.37934236, 1.13747472, 0.49256149, 0.94090189, 0.575934353], [0.5741806380568624, 2.601763378415666, 1.1403599519431376, 0.4050669280568624, 1.5482728084156658], [0.52773977, 0.66921742, 1.05365803, 0.55999976, 0.152349682], [1.68253872, 1.3574706, 1.85281788, 0.80192163, 0.689695707], [0.1536601806150577, 1.36003416, 0.20346363061505768, 1.0767081506150575, 0.269293988], [2.71698415, 4.464557993088751, 0.78701173, 1.69377715, 2.682300339088751], [1.6045785, 1.9168182341324442, 1.09867346, 0.17549086, 0.9674837841324442], [0.9920012, 0.8535824, 1.10725097, 0.52699769, 0.705725023], [1.09397133, 0.26671179, 1.63491138, 1.52603672, 0.637721453], [0.6486252033989663, 1.289888482651614, 0.6149134233989664, 0.4834490533989664, 1.884306267651614], [1.80885343, 1.30298162, 0.34997672, 1.31313875, 1.81040324], [1.34405876, 4.18913156, 11.91426406, 10.29232846, 11.4022841], [20.67932055, 0.9468949, 1.07551952, 26.04833009, 1.41792767], [1.14022578, 29.00931534, 20.95590433, 0.37512849, 18.0681124], [28.40089904, 7.04472224, 24.12025401, 9.19901589, 11.5542589], [14.671188024607485, 4.765009020585461, 20.112849734607487, 17.860751635392514, 20.98285886941454], [7.38124482, 14.47096118, 3.69156376, 25.87962079, 14.2527562], [12.12622874, 7.51008681, 20.35730663, 7.07386449, 1.42548515], [15.13166867, 6.87904454, 6.46974537, 8.11152706, 14.4897947], [32.90880771, 13.9561642, 13.42841392, 26.57871917, 7.3568118]]  [[0.29132869, 0.8557475, 0.13176070608300083, 0.47092471, 0.116552148], [1.94811937, 1.93360377, 1.443557613916999, 1.49090388, 1.47797459], [1.7276976, 0.31294082, 0.6625931639169991, 0.13276539, 1.21258438], [0.60992108, 0.44979634, 0.9206932160830008, 0.14971593, 0.0230026774], [1.26241941, 1.25960367, 1.6478253160830008, 1.70488311, 0.720304694], [1.47374999, 0.2857751, 0.6164329460830009, 1.54542686, 0.300584391], [2.36994795, 0.70045919, 0.7691936039169991, 1.15809336, 2.11149651], [0.1789954, 1.39591933, 0.891145293916999, 0.08510231, 1.25044571], [1.17736161, 0.13365899, 0.11877678391699908, 1.88856105, 0.21527211], [0.46428297, 0.8439945, 0.8704247060830008, 0.49502568, 0.63643186], [2.37934236, 1.13747472, 1.1460369960830008, 0.94090189, 0.575934353], [1.97664288, 0.96123988, 0.39137321608300085, 1.80752917, 2.01473045], [0.52773977, 0.66921742, 0.40018252391699916, 0.55999976, 0.152349682], [1.68253872, 1.3574706, 1.199342373916999, 0.80192163, 0.689695707], [1.07443294, 1.36003416, 0.37115398391699905, 0.15138497, 0.269293988], [2.71698415, 0.89376979, 1.4404872360830008, 1.69377715, 0.888487864], [1.6045785, 0.90144892, 1.752148966083001, 0.17549086, 1.85078337], [0.9920012, 0.8535824, 0.4537754639169991, 0.52699769, 0.705725023], [1.09397133, 0.26671179, 0.981435873916999, 1.52603672, 0.637721453], [1.20741447, 0.22671035, 0.5876507439169991, 1.37259062, 0.367707435], [1.80885343, 1.30298162, 1.003452226083001, 1.31313875, 1.81040324], [1.34405876, 4.18913156, 12.567739566083002, 10.29232846, 11.4022841], [20.67932055, 0.9468949, 0.4220440139169992, 26.04833009, 1.41792767], [1.14022578, 29.00931534, 20.302428823916998, 0.37512849, 18.0681124], [28.40089904, 7.04472224, 24.773729516083, 9.19901589, 11.5542589], [16.12079604, 1.42687889, 20.908982243917, 16.41114362, 24.320989], [7.38124482, 14.47096118, 3.0380882539169995, 25.87962079, 14.2527562], [12.12622874, 7.51008681, 19.703831123917, 7.07386449, 1.42548515], [15.13166867, 6.87904454, 5.816269863916999, 8.11152706, 14.4897947], [32.90880771, 13.9561642, 12.774938413916999, 26.57871917, 7.3568118]]       1                [153.85323658695867, 128.40599750279642, 153.0465675852285, 165.41002400143392, 125.66032792475319]  [2.1813174976757135, 2.2630029861386856, 2.2515215010407865, 1.9905121497628162, 1.9523022468597042, 1.6595544202700014, 2.6171940683889328, 2.319283728375569, 2.5872480860838754, 1.1485485101088428, 2.1555447753499513, 2.742749965176817, 1.656270472936589, 1.3843351846019845, 2.2676307660784043, 2.3737304527385055, 3.0409267317990967, 1.163141930234062, 1.4515961194274143, 1.4800956009110389, 1.9193782356188966, 34.150458881656, 42.800084970628916, 61.05363913607387, 59.72959654230913, 60.70438641219785, 51.21650213485706, 40.897081919778586, 29.49160252115608, 57.91600880946933]       1\n",
      "[[0.0266561, 0.227730874, 0.06343853, 0.12282237, 0.69583932], [1.182531702294729, 2.1469330239830313, 1.3830089522947293, 1.2155546122947292, 2.1496448222947295], [0.84281539, 0.0107832767, 1.7756218, 0.52944738, 0.96670326], [0.49503168, 0.0972417712, 0.03078451, 0.68663188, 0.44210325], [1.18619684, 2.17616114, 0.55164198, 1.17090808, 0.59606549], [1.53450346, 0.488667993, 0.19553961, 0.65621051, 0.33030086], [2.59183152, 4.1314785975326345, 1.39801553, 0.67362715, 1.45365818], [2.465496629837075, 0.49977645961282713, 0.9397316098370749, 2.398784099837075, 1.9421878298370752], [1.43063062, 0.0642575329, 1.18183893, 1.79278833, 0.71515938], [0.04718107, 0.257197525, 0.03955416, 0.14167161, 0.08404491], [1.59537505, 1.72384798, 0.47674046, 0.10092116, 0.8561574], [0.9007476980568623, 2.6268018604156658, 1.3604137519431376, 0.4818649880568624, 0.021667341943137686], [0.70494473, 0.307668556, 1.65532651, 1.25762303, 0.62253036], [0.79954149, 1.81908032, 1.42349039, 1.2240933, 0.81216214], [0.6104214406150577, 0.901756832, 0.5162023206150576, 0.1972515306150575, 1.6657459406150577], [2.03670536, 4.251229995088751, 1.12871284, 1.55835716, 1.09031985], [1.56815847, 1.5459359241324442, 0.57391866, 0.24365917, 1.25787573], [0.55904809, 1.45780828, 1.15819722, 0.69771459, 0.0741466], [0.98331514, 0.481722748, 2.31395329, 1.79552698, 0.97568411], [0.06004024339896641, 1.355760012651614, 0.12537409339896644, 1.1375188833989665, 1.9104911433989664], [2.36509411, 1.28510952, 0.2845753, 0.46969943, 0.94227557], [8.97326176, 9.30987584, 13.32688457, 11.62093989, 22.29941375], [11.79496445, 10.4554355, 2.62680401, 25.39511668, 6.85443505], [6.21452245, 25.0792477, 18.37623135, 4.3249073, 21.8427763], [23.37675169, 0.304080828, 13.44823607, 10.84026304, 6.74829032], [27.908929555392515, 7.820808980585461, 14.036238145392513, 14.443542225392516, 25.153090305392514], [1.82586441, 10.9099535, 14.48300707, 15.0325705, 9.44233507], [17.00978883, 3.69566599, 9.90008467, 12.19589652, 4.29718812], [11.42588866, 5.92624619, 0.09487463, 8.03079308, 8.36262444], [26.41579881, 18.1082616, 17.40007667, 40.59071569, 2.34221339]]      [[0.0266561, 0.227730874, 0.5900369760830009, 0.12282237, 0.69583932], [2.11295685, 1.7473427, 1.259004093916999, 2.07993394, 1.14584373], [0.84281539, 0.0107832767, 1.122146293916999, 0.52944738, 0.96670326], [0.49503168, 0.0972417712, 0.6842600160830009, 0.68663188, 0.44210325], [1.18619684, 2.17616114, 1.205117486083001, 1.17090808, 0.59606549], [1.53450346, 0.488667993, 0.8490151160830008, 0.65621051, 0.33030086], [2.59183152, 0.267610076, 0.744540023916999, 0.67362715, 1.45365818], [0.05013556, 1.69136828, 0.9224250739169992, 0.11684809, 0.57344436], [1.43063062, 0.0642575329, 0.5283634239169992, 1.79278833, 0.71515938], [0.04718107, 0.257197525, 0.6930296660830009, 0.14167161, 0.08404491], [1.59537505, 1.72384798, 1.130215966083001, 0.10092116, 0.8561574], [2.30320994, 0.936201398, 0.6114270160830009, 1.88432723, 1.3807949], [0.70494473, 0.307668556, 1.0018510039169992, 1.25762303, 0.62253036], [0.79954149, 1.81908032, 0.7700148839169991, 1.2240933, 0.81216214], [0.61767168, 0.901756832, 0.05841529391699918, 1.03084159, 0.43765282], [2.03670536, 0.680441792, 1.7821883460830008, 1.55835716, 1.09031985], [1.56815847, 1.27233123, 1.227394166083001, 0.24365917, 1.25787573], [0.55904809, 1.45780828, 0.504721713916999, 0.69771459, 0.0741466], [0.98331514, 0.481722748, 1.6604777839169993, 1.79552698, 0.97568411], [1.79599943, 0.16083882, 1.077190073916999, 0.71852079, 0.05445147], [2.36509411, 1.28510952, 0.9380508060830008, 0.46969943, 0.94227557], [8.97326176, 9.30987584, 13.980360076083002, 11.62093989, 22.29941375], [11.79496445, 10.4554355, 1.973328503916999, 25.39511668, 6.85443505], [6.21452245, 25.0792477, 17.722755843917, 4.3249073, 21.8427763], [23.37675169, 0.304080828, 14.101711576083002, 10.84026304, 6.74829032], [26.45932154, 4.48267885, 13.240105636083001, 12.99393421, 23.70348229], [1.82586441, 10.9099535, 13.829531563916998, 15.0325705, 9.44233507], [17.00978883, 3.69566599, 9.246609163916998, 12.19589652, 4.29718812], [11.42588866, 5.92624619, 0.7483501360830008, 8.03079308, 8.36262444], [26.41579881, 18.1082616, 16.746601163917, 40.59071569, 2.34221339]]  1                [157.5073809677606, 127.14977390133204, 126.08947780410645, 175.62876328097178, 147.28607979132676]  [2.2140614051949417, 2.3391174107299113, 1.9096080937631477, 1.6384291843642884, 2.243541153859323, 1.4964410369465355, 2.619717210816089, 2.265551206614674, 1.9116437583235397, 2.2065792246941145, 2.339184646217153, 1.978885701029861, 1.4463501818601137, 1.861316399771042, 1.9875899955611496, 2.200346138348065, 1.9001613387340623, 2.0251207688179194, 2.416394012559629, 2.3922147443431863, 2.366136884002025, 48.11875113299422, 42.75763646649411, 57.847575532113964, 40.06209176321024, 52.139351605908, 39.40902458726344, 28.63264900589477, 19.845506041027235, 75.19771260082533]            1\n",
      "[[0.04002373, 0.77316403, 0.5064642, 0.00495428, 0.09601987], [1.1238042339830314, 1.5055516022947293, 1.5597885722947293, 1.5649069722947293, 2.1033645039830313], [1.18899767, 0.00996767, 1.15883707, 0.32864859, 1.51241607], [0.60047226, 0.06333012, 0.32626716, 0.12331526, 0.15140355], [1.33342528, 1.74399522, 0.93921306, 1.38895531, 0.22029392], [0.9332609, 0.40204323, 0.61178983, 0.80194698, 0.35311483], [2.066731071532634, 0.3841756, 1.45841529, 0.70576781, 1.850926701532634], [1.0695210803871729, 0.4342733298370751, 0.8534892298370751, 1.577046379837075, 0.4448393903871729], [1.54002434, 0.05024028, 0.94871562, 2.34687482, 0.91219142], [0.12563447, 0.53364949, 0.40083787, 0.0124869, 0.11479409], [1.65582437, 2.07842082, 1.33746892, 0.42339452, 1.471586], [1.396375208415666, 0.7899230819431377, 1.5791201619431376, 0.7511363580568624, 1.457103168415666], [0.27858593, 0.539925, 1.81168659, 0.88734299, 0.79785938], [1.33363261, 0.96458172, 1.70129509, 0.80289269, 0.51961445], [0.63004838, 0.2956060406150576, 0.15060095061505763, 0.8238304406150576, 0.47316746], [0.9608684930887512, 0.46253491, 0.68119423, 2.2888359, 2.766814213088751], [1.2780218841324442, 1.1020334, 0.23273985, 0.22907384, 1.1160624241324442], [0.56917252, 1.59779402, 0.39928992, 0.26897599, 0.79817527], [0.72655791, 0.86248362, 1.4249041, 1.54588075, 0.8511636], [0.3651215026516139, 0.8766124233989664, 0.5173199833989663, 0.5051306733989662, 1.6619873626516137], [2.50307969, 1.28409853, 0.37569222, 0.59548962, 1.10266323], [0.34091677, 0.41827883, 0.40994081, 0.19248556, 1.11418798], [1.78544364, 0.21428836, 0.21717019, 2.09446286, 0.05283848], [0.0469913, 1.3041642, 1.18499547, 0.0599024, 0.14234928], [2.3052051, 0.13853662, 2.23490559, 0.86764715, 0.33590364], [1.5142506105854612, 1.8260353653925143, 0.9035846553925144, 0.49092504460748576, 1.853657780585461], [0.12610546, 1.32348276, 0.17562612, 1.24092046, 1.6688788], [1.5179853, 0.03971839, 0.69806029, 1.21382899, 0.64356563], [1.08815115, 0.28628336, 0.52470708, 0.28861945, 0.74619109], [2.71393575, 1.53879333, 2.11374314, 1.45708077, 0.94730833]]                                  [[0.04002373, 0.77316403, 0.14701130608300084, 0.00495428, 0.09601987], [2.77047149, 1.78993695, 1.082224473916999, 1.73058158, 1.79091122], [1.18899767, 0.00996767, 0.505361563916999, 0.32864859, 1.51241607], [0.60047226, 0.06333012, 0.32720834608300087, 0.12331526, 0.15140355], [1.33342528, 1.74399522, 1.5926885660830008, 1.38895531, 0.22029392], [0.9332609, 0.40204323, 1.2652653360830008, 0.80194698, 0.35311483], [1.79713745, 0.3841756, 0.8049397839169992, 0.70576781, 2.01294182], [0.12207074, 2.08135886, 1.008667453916999, 0.93858581, 0.74675243], [1.54002434, 0.05024028, 0.2952401139169991, 2.34687482, 0.91219142], [0.12563447, 0.53364949, 1.0543133760830008, 0.0124869, 0.11479409], [1.65582437, 2.07842082, 1.990944426083001, 0.42339452, 1.471586], [2.16662805, 0.61253916, 0.8301334260830009, 2.1535986, 2.10590009], [0.27858593, 0.539925, 1.1582110839169992, 0.88734299, 0.79785938], [1.33363261, 0.96458172, 1.047819583916999, 0.80289269, 0.51961445], [0.63004838, 0.93248708, 0.4240166639169991, 0.40426268, 0.47316746], [2.60991971, 0.46253491, 1.3346697360830009, 2.2888359, 0.80397399], [1.54024527, 1.1020334, 0.8862153560830008, 0.22907384, 1.70220473], [0.56917252, 1.59779402, 0.25418558608300085, 0.26897599, 0.79817527], [0.72655791, 0.86248362, 0.7714285939169991, 1.54588075, 0.8511636], [1.15147733, 0.97942725, 0.6852441839169991, 1.350909, 0.14538853], [2.50307969, 1.28409853, 0.27778328608300085, 0.59548962, 1.10266323], [0.34091677, 0.41827883, 1.0634163160830008, 0.19248556, 1.11418798], [1.78544364, 0.21428836, 0.4363053160830008, 2.09446286, 0.05283848], [0.0469913, 1.3041642, 0.5315199639169992, 0.0599024, 0.14234928], [2.3052051, 0.13853662, 1.581430083916999, 0.86764715, 0.33590364], [1.82387952, 0.37642735, 0.10745214608300091, 1.94053306, 1.48447235], [0.12610546, 1.32348276, 0.8291016260830009, 1.24092046, 1.6688788], [1.5179853, 0.03971839, 1.351535796083001, 1.21382899, 0.64356563], [1.08815115, 0.28628336, 0.12876842608300088, 0.28861945, 0.74619109], [2.71393575, 1.53879333, 1.460267633916999, 1.45708077, 0.94730833]]                               0                [5.883308646650005, 5.285290132001996, 5.622920195883968, 6.217443926347431, 6.37648088621213]       [2.5154458050758652, 2.7934892998685825, 2.447766418460464, 2.2765787313083896, 2.3681852307624403, 1.4670476432296575, 2.572733815766297, 2.553063049699648, 2.79630973719089, 2.177672552106058, 3.117077805914653, 2.9410346687824487, 1.6966290468395036, 0.8489191473851929, 1.4734665121616501, 2.68665140207579, 2.2323074046525715, 2.296106734262755, 1.497728521585621, 1.5070834225073921, 2.785434101623688, 2.0949829910557396, 2.697767074216563, 2.3011807959601103, 2.9805445798174177, 2.616041622547988, 2.96140924216861, 1.8771865139379387, 2.0289141888387667, 2.5317197100301096]          0\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: The `gcloud ml-engine` commands have been renamed and will soon be removed. Please use `gcloud ai-platform` instead.\n",
      "WARNING: 2019-07-12 20:42:57.644411: I tensorflow/core/platform/cpu_feature_guard.cc:145] This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical operations:  AVX2 FMA\n",
      "To enable them in non-MKL-DNN operations, rebuild TensorFlow with the appropriate compiler flags.\n",
      "2019-07-12 20:42:57.654384: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:42:57.655704: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55fc871beea0 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:42:57.655732: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "2019-07-12 20:42:57.658551: I tensorflow/core/common_runtime/process_util.cc:115] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.\n",
      "WARNING: Logging before flag parsing goes to stderr.\n",
      "W0712 20:42:57.658842 139812382725568 deprecation.py:323] From /usr/lib/google-cloud-sdk/lib/third_party/ml_sdk/cloud/ml/prediction/frameworks/tf_prediction_lib.py:210: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function for importing SavedModels in Tensorflow 2.0.\n",
      "W0712 20:42:57.819281 139812382725568 deprecation.py:323] From /usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py:1276: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "2019-07-12 20:42:57.902846: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "model_dir=$(ls ${PWD}/trained_model/dense_labeled/export/exporter | tail -1)\n",
    "gcloud ml-engine local predict \\\n",
    "  --model-dir=${PWD}/trained_model/dense_labeled/export/exporter/${model_dir} \\\n",
    "  --json-instances=./test_sequences.json"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### LSTM Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_FEAT_ABS_RECON_ERR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     X_TIME_ABS_RECON_ERR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     FEAT_ANOM_FLAGS  MAHALANOBIS_DIST_FEAT                                                                                MAHALANOBIS_DIST_TIME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            TIME_ANOM_FLAGS\n",
      "[[0.2429063256002827, 0.2526802507519656, 0.494526887461713, 0.08971067311740494, 0.2939971644476433], [1.4925072656002825, 1.5183518392480346, 0.982529777461713, 1.1649177131174049, 1.632998485552357], [1.3303342956002826, 0.7776291507519656, 1.632868957461713, 0.6401282168825951, 0.5852111355523568], [1.2060179943997174, 0.1846443707519656, 0.22831615746171308, 0.6149363368825951, 0.5448411744476432], [1.1781099943997173, 1.7291178092480344, 0.896597462538287, 1.656288383117405, 1.0089641444476434], [0.4199668356002827, 0.4607944107519656, 0.779092652538287, 0.5212053731174049, 0.08549487555235674], [1.9086807856002825, 0.28307743075196556, 0.854352197461713, 1.3613982868825951, 1.0618934455523568], [0.25557471560028266, 1.5313217792480343, 1.135892367461713, 0.3006356268825951, 0.7701067755523567], [2.0261977843997174, 0.2553755892480344, 1.180644557461713, 1.015632173117405, 1.0297272044476433], [0.5877504443997174, 1.0808422807519655, 0.945009632538287, 0.6662389968825951, 0.5693295644476433], [1.2355098556002826, 1.1683618592480345, 1.129249722538287, 1.2145236968825952, 0.7233526255523568], [0.9612103456002826, 0.35539827924803447, 0.659527952538287, 0.9454824931174048, 1.6768012455523567], [1.0758095443997173, 0.7765827407519657, 1.236292977461713, 1.029339823117405, 0.07287367555235674], [1.4110880043997174, 1.1783678492480343, 1.437717227461713, 1.249161926882595, 1.0021784644476432], [0.4377307756002826, 0.9714588192480343, 0.450726847461713, 0.49836557311740487, 0.6833658644476432], [1.8674596756002826, 1.5395751607519657, 1.6005287325382869, 1.886658833117405, 0.4356298755523567], [0.8862667856002827, 0.7531547392480343, 0.834577272538287, 0.4455573868825951, 1.2283910955523567], [1.7032276243997173, 1.2911669092480342, 0.5929625674617129, 0.7687091768825951, 0.029594385552356717], [1.2671890943997175, 1.2183248207519655, 1.183695507461713, 1.3768712431174048, 1.4063550744476432], [0.7392702956002827, 0.4529790392480344, 1.029112457461713, 0.16992879311740489, 0.6048683444476433], [2.1250942956002827, 0.8187023692480343, 0.033927402538286966, 1.7253664068825951, 1.2746347855523568], [0.49916536439971737, 0.5527263207519656, 1.575201982538287, 0.3755644331174049, 1.4502869055523568], [1.4142333943997174, 0.5869305907519656, 0.7364413125382869, 1.866103213117405, 0.6434865144476433], [0.5685839243997174, 1.751089689248034, 1.305365897461713, 1.136501286882595, 0.5177583944476433], [1.6339463156002827, 0.17458343075196558, 1.7810522074617132, 1.1743052868825952, 0.003027465552356723], [1.0918267556002825, 0.7071587207519656, 0.22434920746171305, 1.016842563117405, 1.6077761855523567], [0.9582480543997174, 1.1841216192480344, 1.211232782538287, 0.3935004031174049, 0.8414843755523569], [1.1771611543997174, 0.4791430207519656, 1.0846738925382868, 1.7764264068825952, 0.8077987744476433], [0.059720995600282656, 0.9148664807519656, 0.11611003253828694, 0.03030037311740491, 0.5656044544476433], [1.8880132656002826, 1.6123494892480341, 1.047143697461713, 0.9420491731174048, 0.3017544244476433]]              [[0.2429063256002827, 0.2526802507519656, 0.494526887461713, 0.08971067311740494, 0.2939971644476433], [1.4925072656002825, 1.5183518392480346, 0.982529777461713, 1.1649177131174049, 1.632998485552357], [1.3303342956002826, 0.7776291507519656, 1.632868957461713, 0.6401282168825951, 0.5852111355523568], [1.2060179943997174, 0.1846443707519656, 0.22831615746171308, 0.6149363368825951, 0.5448411744476432], [1.1781099943997173, 1.7291178092480344, 0.896597462538287, 1.656288383117405, 1.0089641444476434], [0.4199668356002827, 0.4607944107519656, 0.779092652538287, 0.5212053731174049, 0.08549487555235674], [1.9086807856002825, 0.28307743075196556, 0.854352197461713, 1.3613982868825951, 1.0618934455523568], [0.25557471560028266, 1.5313217792480343, 1.135892367461713, 0.3006356268825951, 0.7701067755523567], [2.0261977843997174, 0.2553755892480344, 1.180644557461713, 1.015632173117405, 1.0297272044476433], [0.5877504443997174, 1.0808422807519655, 0.945009632538287, 0.6662389968825951, 0.5693295644476433], [1.2355098556002826, 1.1683618592480345, 1.129249722538287, 1.2145236968825952, 0.7233526255523568], [0.9612103456002826, 0.35539827924803447, 0.659527952538287, 0.9454824931174048, 1.6768012455523567], [1.0758095443997173, 0.7765827407519657, 1.236292977461713, 1.029339823117405, 0.07287367555235674], [1.4110880043997174, 1.1783678492480343, 1.437717227461713, 1.249161926882595, 1.0021784644476432], [0.4377307756002826, 0.9714588192480343, 0.450726847461713, 0.49836557311740487, 0.6833658644476432], [1.8674596756002826, 1.5395751607519657, 1.6005287325382869, 1.886658833117405, 0.4356298755523567], [0.8862667856002827, 0.7531547392480343, 0.834577272538287, 0.4455573868825951, 1.2283910955523567], [1.7032276243997173, 1.2911669092480342, 0.5929625674617129, 0.7687091768825951, 0.029594385552356717], [1.2671890943997175, 1.2183248207519655, 1.183695507461713, 1.3768712431174048, 1.4063550744476432], [0.7392702956002827, 0.4529790392480344, 1.029112457461713, 0.16992879311740489, 0.6048683444476433], [2.1250942956002827, 0.8187023692480343, 0.033927402538286966, 1.7253664068825951, 1.2746347855523568], [0.49916536439971737, 0.5527263207519656, 1.575201982538287, 0.3755644331174049, 1.4502869055523568], [1.4142333943997174, 0.5869305907519656, 0.7364413125382869, 1.866103213117405, 0.6434865144476433], [0.5685839243997174, 1.751089689248034, 1.305365897461713, 1.136501286882595, 0.5177583944476433], [1.6339463156002827, 0.17458343075196558, 1.7810522074617132, 1.1743052868825952, 0.003027465552356723], [1.0918267556002825, 0.7071587207519656, 0.22434920746171305, 1.016842563117405, 1.6077761855523567], [0.9582480543997174, 1.1841216192480344, 1.211232782538287, 0.3935004031174049, 0.8414843755523569], [1.1771611543997174, 0.4791430207519656, 1.0846738925382868, 1.7764264068825952, 0.8077987744476433], [0.059720995600282656, 0.9148664807519656, 0.11611003253828694, 0.03030037311740491, 0.5656044544476433], [1.8880132656002826, 1.6123494892480341, 1.047143697461713, 0.9420491731174048, 0.3017544244476433]]              0                [5.047761044025482, 5.577740314414558, 5.885505207730732, 6.01592065934673, 5.591323958957069]       [2.240483796369785, 2.545215222258763, 1.9576512801285975, 1.9357458472637057, 2.9705536190761217, 2.0055119468164846, 1.8412636861127756, 2.1445510519649873, 2.5334092856510257, 1.1892548114243893, 1.0967897749183628, 2.603174549950506, 1.836968301961711, 1.416928069624976, 1.557146756251343, 2.889876129612068, 1.7289671993862479, 2.8197155315899005, 2.0006969443374576, 1.9139335077074695, 2.8399411581353986, 3.0796266553144296, 2.4573232396311506, 2.899260796068933, 3.191347502646037, 2.463291918462489, 1.5724193521086176, 2.610299106551526, 2.496098879485934, 2.6865072054570565]     0\n",
      "[[0.24482117439971735, 0.31150131924803437, 0.34762499253828694, 0.03229490688259512, 0.20179572555235675], [1.9426989256002827, 1.4681472892480345, 0.896170357461713, 1.7648376931174048, 0.9681883955523567], [0.9146715156002826, 0.4905151607519656, 1.459145317461713, 0.9513821468825951, 0.5722731255523568], [0.8620184343997174, 0.5786201907519656, 0.6607312525382869, 0.8275346768825951, 0.2578673544476433], [1.6816460143997172, 1.8267816192480342, 1.752859272538287, 0.9913986731174049, 0.9482831344476432], [1.3083048256002825, 0.5453381407519656, 0.34179932253828693, 0.2940595531174049, 0.5640297155523568], [2.1632015156002824, 0.8056252007519655, 0.7170544774617131, 1.6509666368825953, 1.1468544855523568], [0.30846656439971737, 1.1593889192480344, 1.094759127461713, 0.018413276882595087, 0.7979466955523569], [1.5351170943997174, 0.05856584075196558, 0.863495657461713, 1.3288164031174048, 0.41471086444764327], [0.7440014943997173, 0.6139828007519657, 0.28603096253828697, 0.3374252168825951, 0.2767136544476433], [1.0895145856002828, 1.4670087392480342, 0.856790642538287, 1.460667666882595, 0.2538802655523567], [1.7084864356002827, 0.4616569992480344, 0.39469019253828697, 1.576901573117405, 1.1114968955523568], [0.7771367243997174, 1.0702038107519656, 1.358978077461713, 1.0681652931174048, 0.6025837955523567], [1.6954705843997173, 0.7353265592480344, 1.704309107461713, 0.9527169468825951, 1.0282037344476433], [0.12270743560028263, 0.4537270892480344, 0.620956817461713, 0.4545120131174049, 0.9315195144476434], [2.2747026656002824, 0.8886165307519656, 0.822795922538287, 1.563706063117405, 1.1562710755523569], [0.4453171756002826, 0.7775130592480345, 0.874447132538287, 0.3924528468825951, 1.2309160855523569], [1.6673310443997176, 1.1952837492480346, 0.212041457461713, 1.294524966882595, 0.28570209555235676], [0.8472124443997173, 1.1839320807519655, 1.0411472174617131, 1.1908286931174048, 0.7745664244476433], [1.0225214856002824, 0.7380696892480344, 0.5336062374617131, 0.10503789311740491, 0.0991976655523567], [1.5212311056002825, 1.3284052892480345, 0.808378622538287, 1.4298654768825951, 0.5934237755523568], [0.01713567439971736, 0.4293757707519656, 1.460802242538287, 0.19504414311740487, 0.8632616055523568], [1.4378762343997176, 0.13979431924803443, 0.2589769125382869, 1.4215011731174048, 0.2783746744476433], [0.16579046439971734, 1.2943352692480343, 0.563447497461713, 0.7675174768825951, 1.0200771744476433], [1.3567690456002826, 0.1723052107519656, 1.734846007461713, 0.5888320568825951, 0.4275010844476433], [1.1484397856002828, 0.5027361407519656, 0.41180364746171305, 1.605365883117405, 0.8764874155523568], [1.2156011543997174, 1.0469158192480346, 1.382839422538287, 0.20160034311740488, 1.1828492055523567], [1.7810930343997176, 0.4704069407519656, 1.417023012538287, 1.0271839568825951, 0.05879772444764325], [0.3155437756002827, 1.1288052407519658, 0.15979778253828697, 0.46284044311740485, 0.4908139844476433], [2.2076463556002826, 1.4661190692480344, 1.6785058574617129, 1.341285353117405, 0.042418174447643286]]  [[0.24482117439971735, 0.31150131924803437, 0.34762499253828694, 0.03229490688259512, 0.20179572555235675], [1.9426989256002827, 1.4681472892480345, 0.896170357461713, 1.7648376931174048, 0.9681883955523567], [0.9146715156002826, 0.4905151607519656, 1.459145317461713, 0.9513821468825951, 0.5722731255523568], [0.8620184343997174, 0.5786201907519656, 0.6607312525382869, 0.8275346768825951, 0.2578673544476433], [1.6816460143997172, 1.8267816192480342, 1.752859272538287, 0.9913986731174049, 0.9482831344476432], [1.3083048256002825, 0.5453381407519656, 0.34179932253828693, 0.2940595531174049, 0.5640297155523568], [2.1632015156002824, 0.8056252007519655, 0.7170544774617131, 1.6509666368825953, 1.1468544855523568], [0.30846656439971737, 1.1593889192480344, 1.094759127461713, 0.018413276882595087, 0.7979466955523569], [1.5351170943997174, 0.05856584075196558, 0.863495657461713, 1.3288164031174048, 0.41471086444764327], [0.7440014943997173, 0.6139828007519657, 0.28603096253828697, 0.3374252168825951, 0.2767136544476433], [1.0895145856002828, 1.4670087392480342, 0.856790642538287, 1.460667666882595, 0.2538802655523567], [1.7084864356002827, 0.4616569992480344, 0.39469019253828697, 1.576901573117405, 1.1114968955523568], [0.7771367243997174, 1.0702038107519656, 1.358978077461713, 1.0681652931174048, 0.6025837955523567], [1.6954705843997173, 0.7353265592480344, 1.704309107461713, 0.9527169468825951, 1.0282037344476433], [0.12270743560028263, 0.4537270892480344, 0.620956817461713, 0.4545120131174049, 0.9315195144476434], [2.2747026656002824, 0.8886165307519656, 0.822795922538287, 1.563706063117405, 1.1562710755523569], [0.4453171756002826, 0.7775130592480345, 0.874447132538287, 0.3924528468825951, 1.2309160855523569], [1.6673310443997176, 1.1952837492480346, 0.212041457461713, 1.294524966882595, 0.28570209555235676], [0.8472124443997173, 1.1839320807519655, 1.0411472174617131, 1.1908286931174048, 0.7745664244476433], [1.0225214856002824, 0.7380696892480344, 0.5336062374617131, 0.10503789311740491, 0.0991976655523567], [1.5212311056002825, 1.3284052892480345, 0.808378622538287, 1.4298654768825951, 0.5934237755523568], [0.01713567439971736, 0.4293757707519656, 1.460802242538287, 0.19504414311740487, 0.8632616055523568], [1.4378762343997176, 0.13979431924803443, 0.2589769125382869, 1.4215011731174048, 0.2783746744476433], [0.16579046439971734, 1.2943352692480343, 0.563447497461713, 0.7675174768825951, 1.0200771744476433], [1.3567690456002826, 0.1723052107519656, 1.734846007461713, 0.5888320568825951, 0.4275010844476433], [1.1484397856002828, 0.5027361407519656, 0.41180364746171305, 1.605365883117405, 0.8764874155523568], [1.2156011543997174, 1.0469158192480346, 1.382839422538287, 0.20160034311740488, 1.1828492055523567], [1.7810930343997176, 0.4704069407519656, 1.417023012538287, 1.0271839568825951, 0.05879772444764325], [0.3155437756002827, 1.1288052407519658, 0.15979778253828697, 0.46284044311740485, 0.4908139844476433], [2.2076463556002826, 1.4661190692480344, 1.6785058574617129, 1.341285353117405, 0.042418174447643286]]  0                [5.558542996183101, 5.224191336442904, 6.6182407312626985, 5.347630904561133, 5.210620403254365]     [2.3888650680025862, 2.3116326439463326, 1.8175418908637444, 1.3717966949778004, 2.64777347031261, 2.3542243261895113, 1.912747906185242, 2.0208044803041676, 1.998473508175324, 1.9038623477510987, 2.7826302823451154, 1.9034371012274136, 1.6632429720207527, 2.271343633422152, 2.028814592907455, 2.0176088524179723, 1.848164809552414, 2.652603592782623, 1.6172076700038673, 2.527802114770745, 1.8079005866331987, 2.8127265483871025, 2.368081629638097, 2.4980422308473234, 3.002466928924176, 2.257794804431365, 2.7740785958169174, 2.396951515677894, 2.3752013757758177, 3.0620521205490423]      0\n",
      "[[0.1420630856002827, 0.5996157592480345, 0.354664297461713, 0.09880074311740489, 0.5561858055523567], [1.7953432556002826, 1.4778036892480344, 1.344052607461713, 1.8743093031174047, 1.5356899255523568], [1.0622423256002826, 1.0787675207519656, 0.743105537461713, 0.4459727268825951, 0.8470527355523567], [0.8802863343997174, 0.7634994707519656, 0.24386551746171303, 1.348213146882595, 0.19180078444764329], [1.1620266243997173, 1.6271428592480341, 0.953104952538287, 0.9163896231174049, 0.41256796444764327], [0.7557915856002827, 0.8071878207519656, 1.086462562538287, 0.4681652731174049, 0.0648196944476433], [2.0902856556002827, 1.1030274807519655, 0.41838061746171307, 1.4519287868825952, 0.8282633255523568], [0.3908999856002826, 1.2076144392480344, 1.3761301874617131, 0.23006615311740491, 0.027022224447643295], [1.3195794143997173, 0.0925835907519656, 0.567644087461713, 1.703191653117405, 1.2151513544476433], [0.46912149439971734, 0.9981969907519656, 0.46453106253828697, 0.6555883468825952, 0.4826688844476433], [1.8468832056002826, 1.4254894792480344, 1.766523472538287, 0.5860632468825951, 1.0311086955523567], [1.6665553056002826, 0.3508441492480344, 0.15635715746171308, 1.0116986431174049, 1.5860627755523569], [0.7664214143997173, 0.5923638807519656, 0.784260267461713, 0.7802280031174049, 0.19630740444764327], [1.6855138943997172, 0.7179603392480344, 1.668077307461713, 1.1062830668825951, 1.3681125944476433], [0.4058705556002826, 1.0579925192480344, 0.49183312746171304, 0.1364473731174049, 0.9851402244476433], [1.9910960556002824, 0.7024311607519655, 1.3788025725382869, 1.873374543117405, 1.2325552155523567], [0.4493590656002826, 0.48671071924803444, 0.657161662538287, 0.3866359868825951, 0.8432410855523569], [1.1926968943997174, 1.2176421192480342, 0.654492177461713, 1.000488826882595, 0.18738485444764327], [1.7197949843997176, 1.2652445007519657, 1.325331427461713, 1.1263028231174048, 1.4712167544476433], [1.0953150256002826, 0.24352112924803437, 0.896948687461713, 0.9401800531174049, 0.27817002444764327], [1.6628284056002824, 1.4704936592480342, 0.05665697253828694, 1.6817733268825952, 0.7229497655523567], [0.31174451439971734, 0.9664396807519656, 0.844434542538287, 0.39481893311740485, 1.2181979655523567], [1.3570046943997174, 0.1152888507519656, 0.953250802538287, 1.879372003117405, 0.01172589444764327], [0.10747221439971738, 0.9001798892480345, 1.255544707461713, 0.3226066268825951, 0.9974842944476432], [1.6166783556002824, 0.3208770907519656, 1.930739977461713, 1.020497126882595, 0.4905047644476433], [1.7513677656002824, 0.1916387407519656, 0.738255507461713, 1.2028621931174048, 1.3239866855523568], [0.39944396439971736, 0.9120802892480343, 1.383449642538287, 0.37723180311740495, 0.5890662055523568], [1.1876975943997174, 0.7544921707519656, 1.215712252538287, 1.062682746882595, 0.27167033444764327], [0.19883923439971735, 1.2329104707519656, 0.29514927253828693, 0.6623215731174048, 0.9385017144476433], [1.9897658256002826, 1.6341731092480343, 1.412222387461713, 1.7438150731174047, 0.02694651555235672]]     [[0.1420630856002827, 0.5996157592480345, 0.354664297461713, 0.09880074311740489, 0.5561858055523567], [1.7953432556002826, 1.4778036892480344, 1.344052607461713, 1.8743093031174047, 1.5356899255523568], [1.0622423256002826, 1.0787675207519656, 0.743105537461713, 0.4459727268825951, 0.8470527355523567], [0.8802863343997174, 0.7634994707519656, 0.24386551746171303, 1.348213146882595, 0.19180078444764329], [1.1620266243997173, 1.6271428592480341, 0.953104952538287, 0.9163896231174049, 0.41256796444764327], [0.7557915856002827, 0.8071878207519656, 1.086462562538287, 0.4681652731174049, 0.0648196944476433], [2.0902856556002827, 1.1030274807519655, 0.41838061746171307, 1.4519287868825952, 0.8282633255523568], [0.3908999856002826, 1.2076144392480344, 1.3761301874617131, 0.23006615311740491, 0.027022224447643295], [1.3195794143997173, 0.0925835907519656, 0.567644087461713, 1.703191653117405, 1.2151513544476433], [0.46912149439971734, 0.9981969907519656, 0.46453106253828697, 0.6555883468825952, 0.4826688844476433], [1.8468832056002826, 1.4254894792480344, 1.766523472538287, 0.5860632468825951, 1.0311086955523567], [1.6665553056002826, 0.3508441492480344, 0.15635715746171308, 1.0116986431174049, 1.5860627755523569], [0.7664214143997173, 0.5923638807519656, 0.784260267461713, 0.7802280031174049, 0.19630740444764327], [1.6855138943997172, 0.7179603392480344, 1.668077307461713, 1.1062830668825951, 1.3681125944476433], [0.4058705556002826, 1.0579925192480344, 0.49183312746171304, 0.1364473731174049, 0.9851402244476433], [1.9910960556002824, 0.7024311607519655, 1.3788025725382869, 1.873374543117405, 1.2325552155523567], [0.4493590656002826, 0.48671071924803444, 0.657161662538287, 0.3866359868825951, 0.8432410855523569], [1.1926968943997174, 1.2176421192480342, 0.654492177461713, 1.000488826882595, 0.18738485444764327], [1.7197949843997176, 1.2652445007519657, 1.325331427461713, 1.1263028231174048, 1.4712167544476433], [1.0953150256002826, 0.24352112924803437, 0.896948687461713, 0.9401800531174049, 0.27817002444764327], [1.6628284056002824, 1.4704936592480342, 0.05665697253828694, 1.6817733268825952, 0.7229497655523567], [0.31174451439971734, 0.9664396807519656, 0.844434542538287, 0.39481893311740485, 1.2181979655523567], [1.3570046943997174, 0.1152888507519656, 0.953250802538287, 1.879372003117405, 0.01172589444764327], [0.10747221439971738, 0.9001798892480345, 1.255544707461713, 0.3226066268825951, 0.9974842944476432], [1.6166783556002824, 0.3208770907519656, 1.930739977461713, 1.020497126882595, 0.4905047644476433], [1.7513677656002824, 0.1916387407519656, 0.738255507461713, 1.2028621931174048, 1.3239866855523568], [0.39944396439971736, 0.9120802892480343, 1.383449642538287, 0.37723180311740495, 0.5890662055523568], [1.1876975943997174, 0.7544921707519656, 1.215712252538287, 1.062682746882595, 0.27167033444764327], [0.19883923439971735, 1.2329104707519656, 0.29514927253828693, 0.6623215731174048, 0.9385017144476433], [1.9897658256002826, 1.6341731092480343, 1.412222387461713, 1.7438150731174047, 0.02694651555235672]]     0                [5.342871677230716, 6.553115482225231, 5.592301144043172, 5.334156629644584, 6.794904755208432]      [2.025439216965105, 2.851403777975268, 1.4696079827167947, 2.755769420858152, 2.076572449135847, 1.7549926865477148, 2.1844210796295793, 2.4039643337195047, 2.7133591521093354, 1.7191403241151486, 3.137848374273076, 2.849479020812597, 1.4998214959436271, 2.513671588191755, 2.0369017935591445, 2.334206629755302, 1.5055431363892908, 1.9466374450080408, 2.2227448302595953, 1.6436330060692725, 3.320986031542509, 1.9162286703695741, 3.524820425280767, 2.1338043067565144, 2.9087368688201636, 2.227929994487913, 1.7266586716032883, 1.3847622699971356, 2.4944957530217162, 3.2600428440668154]    0\n",
      "[[0.0007491143997173655, 0.43615170924803437, 0.326799437461713, 0.2592028431174049, 0.35677680555235675], [1.4941198156002828, 1.3276286492480343, 1.452219187461713, 1.3245083031174048, 1.2153052855523567], [0.7337666256002827, 1.0892849807519656, 1.238974167461713, 1.0647618968825951, 1.0615492455523567], [0.9343105943997173, 0.5507522407519656, 0.45579461253828696, 0.7557579268825951, 0.5907316844476432], [0.9861394643997173, 1.4126483792480342, 1.209634522538287, 1.134503933117405, 0.6239723044476433], [1.3609101756002828, 0.8247890807519656, 0.37806309253828696, 1.090937283117405, 0.5977148155523566], [1.5435496656002825, 1.0261872307519657, 0.3757115674617131, 1.540305426882595, 1.7033407755523566], [0.1909292256002827, 1.5199877292480344, 1.6247158974617129, 0.3041684631174049, 0.3280073655523567], [1.2663901843997174, 0.4808995807519656, 1.0866820874617131, 1.2735139331174048, 0.7498659844476433], [0.20889006439971736, 1.2869469707519656, 0.28857886253828696, 0.4220588268825951, 0.32741184444764326], [1.3246312556002828, 0.9778721892480343, 1.532860642538287, 1.116807706882595, 0.20806863555235672], [1.4615132056002826, 0.3287606692480344, 0.39271932253828695, 0.9498919131174048, 1.1089821955523569], [0.9336578343997174, 1.5572877707519654, 1.462040717461713, 0.7732876231174048, 0.17812479555235677], [1.4432804143997173, 0.9800039292480344, 1.073680727461713, 1.174934296882595, 0.6132621844476432], [0.3174711056002827, 0.46726943924803443, 0.072726827461713, 0.26300199311740485, 0.6918407144476433], [2.1013687256002824, 1.1741506207519656, 1.0648356625382869, 1.1398795131174049, 1.0191188255523569], [0.32211680560028266, 0.2804144992480344, 1.198133552538287, 0.2047458968825951, 0.8093323855523569], [1.7773724043997174, 0.4410034392480344, 0.03516897746171305, 1.347127886882595, 0.30942457444764326], [1.0163891843997175, 0.8143730407519656, 1.6619874174617129, 1.3581252631174048, 0.6350933044476432], [1.0234273656002828, 0.7593178992480344, 1.079663517461713, 0.9720814931174049, 0.7553460344476433], [1.8441688656002824, 0.7460868992480344, 0.7369344025382869, 1.4420978468825951, 1.1190027555523567], [0.3579078356002826, 1.0797917207519656, 1.524946922538287, 0.2424914668825951, 1.0475710655523567], [1.6508635043997173, 0.17037130924803445, 0.250058902538287, 1.7008785931174049, 0.1461386044476433], [0.8779101143997173, 1.1174964192480346, 0.4014034274617131, 0.8971351568825952, 1.4784073644476432], [1.5384177256002824, 1.1453586507519655, 1.903981237461713, 1.426500776882595, 0.2981041344476433], [1.3025180756002825, 0.7495995707519656, 0.448298807461713, 1.361450423117405, 1.4201928555523569], [0.8458014243997174, 1.6446661492480343, 0.598234092538287, 0.7528989231174048, 1.1814820555523569], [1.5714026143997173, 0.38580298075196556, 1.528462052538287, 1.618545736882595, 0.4323912044476433], [0.5374669156002826, 1.1060648607519656, 0.11938974253828694, 0.6298284831174048, 1.0535196344476432], [1.7958733356002825, 1.2582125992480342, 1.455245727461713, 0.8881256631174048, 0.047752995552356736]]        [[0.0007491143997173655, 0.43615170924803437, 0.326799437461713, 0.2592028431174049, 0.35677680555235675], [1.4941198156002828, 1.3276286492480343, 1.452219187461713, 1.3245083031174048, 1.2153052855523567], [0.7337666256002827, 1.0892849807519656, 1.238974167461713, 1.0647618968825951, 1.0615492455523567], [0.9343105943997173, 0.5507522407519656, 0.45579461253828696, 0.7557579268825951, 0.5907316844476432], [0.9861394643997173, 1.4126483792480342, 1.209634522538287, 1.134503933117405, 0.6239723044476433], [1.3609101756002828, 0.8247890807519656, 0.37806309253828696, 1.090937283117405, 0.5977148155523566], [1.5435496656002825, 1.0261872307519657, 0.3757115674617131, 1.540305426882595, 1.7033407755523566], [0.1909292256002827, 1.5199877292480344, 1.6247158974617129, 0.3041684631174049, 0.3280073655523567], [1.2663901843997174, 0.4808995807519656, 1.0866820874617131, 1.2735139331174048, 0.7498659844476433], [0.20889006439971736, 1.2869469707519656, 0.28857886253828696, 0.4220588268825951, 0.32741184444764326], [1.3246312556002828, 0.9778721892480343, 1.532860642538287, 1.116807706882595, 0.20806863555235672], [1.4615132056002826, 0.3287606692480344, 0.39271932253828695, 0.9498919131174048, 1.1089821955523569], [0.9336578343997174, 1.5572877707519654, 1.462040717461713, 0.7732876231174048, 0.17812479555235677], [1.4432804143997173, 0.9800039292480344, 1.073680727461713, 1.174934296882595, 0.6132621844476432], [0.3174711056002827, 0.46726943924803443, 0.072726827461713, 0.26300199311740485, 0.6918407144476433], [2.1013687256002824, 1.1741506207519656, 1.0648356625382869, 1.1398795131174049, 1.0191188255523569], [0.32211680560028266, 0.2804144992480344, 1.198133552538287, 0.2047458968825951, 0.8093323855523569], [1.7773724043997174, 0.4410034392480344, 0.03516897746171305, 1.347127886882595, 0.30942457444764326], [1.0163891843997175, 0.8143730407519656, 1.6619874174617129, 1.3581252631174048, 0.6350933044476432], [1.0234273656002828, 0.7593178992480344, 1.079663517461713, 0.9720814931174049, 0.7553460344476433], [1.8441688656002824, 0.7460868992480344, 0.7369344025382869, 1.4420978468825951, 1.1190027555523567], [0.3579078356002826, 1.0797917207519656, 1.524946922538287, 0.2424914668825951, 1.0475710655523567], [1.6508635043997173, 0.17037130924803445, 0.250058902538287, 1.7008785931174049, 0.1461386044476433], [0.8779101143997173, 1.1174964192480346, 0.4014034274617131, 0.8971351568825952, 1.4784073644476432], [1.5384177256002824, 1.1453586507519655, 1.903981237461713, 1.426500776882595, 0.2981041344476433], [1.3025180756002825, 0.7495995707519656, 0.448298807461713, 1.361450423117405, 1.4201928555523569], [0.8458014243997174, 1.6446661492480343, 0.598234092538287, 0.7528989231174048, 1.1814820555523569], [1.5714026143997173, 0.38580298075196556, 1.528462052538287, 1.618545736882595, 0.4323912044476433], [0.5374669156002826, 1.1060648607519656, 0.11938974253828694, 0.6298284831174048, 1.0535196344476432], [1.7958733356002825, 1.2582125992480342, 1.455245727461713, 0.8881256631174048, 0.047752995552356736]]        0                [5.000301234481526, 5.10868168736565, 5.4827460092810405, 5.23556491832959, 5.24780986666141]        [2.304480388607781, 1.8263174091049355, 1.7071731141284405, 1.0388213876104435, 1.694079679942244, 1.3241794833602405, 2.768598866102176, 2.6504607025239566, 1.2872401714310067, 2.620977047610677, 1.8467040374825163, 1.7469054628309548, 2.2705373481045115, 0.7662387923091146, 2.1345466883679243, 2.034988844915381, 2.3792211209207803, 2.4532974973065587, 2.2853889943214134, 0.6603287186697976, 1.448576557916225, 2.279008501582909, 2.8855166775956147, 2.246840505612766, 2.518798668996441, 2.0209984480500713, 2.391806969372777, 2.4917666770667246, 2.2654562985650064, 2.531692351317805]    0\n",
      "[[0.3037853756002826, 0.1121248507519656, 0.46718963746171305, 0.48838364311740484, 0.023007595552356708], [2.0532130756002824, 0.9859465992480344, 1.7754660374617128, 1.2720372631174048, 1.1800324955523567], [0.9058697656002827, 1.0559128307519656, 1.417923337461713, 0.9350170668825951, 0.9929029755523568], [1.1746990743997174, 0.14898209075196558, 0.6832689525382869, 1.0670338268825952, 0.2998963444476433], [1.6001718343997173, 1.1906252792480343, 1.351393982538287, 1.138151473117405, 1.0939772144476432], [1.3970565656002827, 0.5635422807519656, 0.43854625253828694, 0.5933031731174048, 0.49734820555235676], [2.3351973756002824, 1.0127519607519657, 0.559241357461713, 1.5754091968825952, 0.7774676355523569], [0.06138332439971733, 1.0998870392480344, 0.959262897461713, 0.00880277688259512, 0.6919496055523569], [1.2595257543997174, 0.059078379248034385, 0.3057281074617131, 1.6319090831174048, 1.2948363844476434], [1.1331572043997173, 0.8149265007519656, 0.9439723525382869, 0.6850154668825951, 0.9939635944476433], [1.5182167756002825, 1.0159156692480344, 1.287811192538287, 0.8484483268825951, 1.1040510355523567], [1.2393012056002828, 0.014689369248034434, 0.21200898253828696, 1.587446873117405, 1.6550172055523567], [0.7387728643997173, 1.2061979607519655, 1.542781707461713, 0.7013896531174049, 0.24378724444764327], [1.3945923543997174, 1.0995354192480344, 1.8256095274617132, 1.6806278268825952, 0.8352598244476432], [0.2277097056002827, 1.0888637292480343, 0.460957717461713, 0.20699084688259511, 0.6395964744476432], [2.2115500756002824, 0.8541479307519656, 1.576877042538287, 1.785087413117405, 0.9869666155523569], [0.5854971956002827, 0.3101818092480344, 0.660792642538287, 1.066135646882595, 1.4136830055523568], [1.8963240943997173, 0.5844385692480344, 0.608040067461713, 0.961233066882595, 0.2868961144476433], [1.1509380443997173, 1.1437740707519657, 1.235761017461713, 0.8722320531174048, 1.0349055244476433], [1.0798398356002825, 0.25011795924803437, 1.110779557461713, 0.9640629131174048, 0.058867814447643274], [1.7898075756002827, 1.2344413092480342, 0.5817460725382869, 1.067325006882595, 0.8033713855523568], [0.15586133439971733, 0.4383095807519656, 1.309533442538287, 0.5432071431174048, 0.8597162355523569], [1.6813667043997174, 0.3430059007519656, 0.726939472538287, 1.1170605431174048, 0.3920893744476433], [0.11540327439971737, 1.1485260592480344, 1.307015527461713, 0.9765344968825951, 0.8882544444476432], [1.4587840856002825, 1.0659101407519656, 1.2678887074617131, 1.4483650668825951, 0.052479614447643264], [1.1978412456002827, 0.7499408607519655, 0.678784977461713, 1.4112721531174048, 1.0487521955523569], [0.47202517439971736, 1.1323129392480342, 0.48472895253828696, 0.41763244311740494, 1.3271086955523568], [1.2631743943997173, 0.41853716075196556, 1.403909782538287, 1.498127346882595, 0.9727849544476432], [0.07267755439971735, 0.7761131807519657, 0.535299412538287, 0.4679003331174049, 1.3400593844476432], [1.7137657056002826, 1.3574352392480344, 1.6288098074617132, 1.6921470131174048, 0.5541323755523566]]  [[0.3037853756002826, 0.1121248507519656, 0.46718963746171305, 0.48838364311740484, 0.023007595552356708], [2.0532130756002824, 0.9859465992480344, 1.7754660374617128, 1.2720372631174048, 1.1800324955523567], [0.9058697656002827, 1.0559128307519656, 1.417923337461713, 0.9350170668825951, 0.9929029755523568], [1.1746990743997174, 0.14898209075196558, 0.6832689525382869, 1.0670338268825952, 0.2998963444476433], [1.6001718343997173, 1.1906252792480343, 1.351393982538287, 1.138151473117405, 1.0939772144476432], [1.3970565656002827, 0.5635422807519656, 0.43854625253828694, 0.5933031731174048, 0.49734820555235676], [2.3351973756002824, 1.0127519607519657, 0.559241357461713, 1.5754091968825952, 0.7774676355523569], [0.06138332439971733, 1.0998870392480344, 0.959262897461713, 0.00880277688259512, 0.6919496055523569], [1.2595257543997174, 0.059078379248034385, 0.3057281074617131, 1.6319090831174048, 1.2948363844476434], [1.1331572043997173, 0.8149265007519656, 0.9439723525382869, 0.6850154668825951, 0.9939635944476433], [1.5182167756002825, 1.0159156692480344, 1.287811192538287, 0.8484483268825951, 1.1040510355523567], [1.2393012056002828, 0.014689369248034434, 0.21200898253828696, 1.587446873117405, 1.6550172055523567], [0.7387728643997173, 1.2061979607519655, 1.542781707461713, 0.7013896531174049, 0.24378724444764327], [1.3945923543997174, 1.0995354192480344, 1.8256095274617132, 1.6806278268825952, 0.8352598244476432], [0.2277097056002827, 1.0888637292480343, 0.460957717461713, 0.20699084688259511, 0.6395964744476432], [2.2115500756002824, 0.8541479307519656, 1.576877042538287, 1.785087413117405, 0.9869666155523569], [0.5854971956002827, 0.3101818092480344, 0.660792642538287, 1.066135646882595, 1.4136830055523568], [1.8963240943997173, 0.5844385692480344, 0.608040067461713, 0.961233066882595, 0.2868961144476433], [1.1509380443997173, 1.1437740707519657, 1.235761017461713, 0.8722320531174048, 1.0349055244476433], [1.0798398356002825, 0.25011795924803437, 1.110779557461713, 0.9640629131174048, 0.058867814447643274], [1.7898075756002827, 1.2344413092480342, 0.5817460725382869, 1.067325006882595, 0.8033713855523568], [0.15586133439971733, 0.4383095807519656, 1.309533442538287, 0.5432071431174048, 0.8597162355523569], [1.6813667043997174, 0.3430059007519656, 0.726939472538287, 1.1170605431174048, 0.3920893744476433], [0.11540327439971737, 1.1485260592480344, 1.307015527461713, 0.9765344968825951, 0.8882544444476432], [1.4587840856002825, 1.0659101407519656, 1.2678887074617131, 1.4483650668825951, 0.052479614447643264], [1.1978412456002827, 0.7499408607519655, 0.678784977461713, 1.4112721531174048, 1.0487521955523569], [0.47202517439971736, 1.1323129392480342, 0.48472895253828696, 0.41763244311740494, 1.3271086955523568], [1.2631743943997173, 0.41853716075196556, 1.403909782538287, 1.498127346882595, 0.9727849544476432], [0.07267755439971735, 0.7761131807519657, 0.535299412538287, 0.4679003331174049, 1.3400593844476432], [1.7137657056002826, 1.3574352392480344, 1.6288098074617132, 1.6921470131174048, 0.5541323755523566]]  0                [5.597708331612258, 5.309344406014028, 5.758532124314192, 4.482382455085977, 5.836449360041259]      [2.57067217527313, 2.488765277199499, 1.4227836483928589, 1.7789148953023606, 1.464019569459654, 1.7429069062658007, 2.253256010267542, 2.0459988232630892, 2.8396513376079957, 0.978535004042138, 1.5751566975263196, 3.3376436928479962, 1.9631818056725956, 2.5903053874351447, 1.9587599641845705, 2.2473480062754096, 2.578459714862931, 2.0451768459641526, 1.1199509068427302, 2.142011165783777, 1.8779572637539785, 2.4482116081912215, 1.5425548637935755, 2.7834565430792098, 2.311452001809476, 1.5221973113786031, 2.2143281863515507, 2.2609625589547626, 2.459322726547154, 2.3474246744384875]   0\n",
      "[[0.09614286439971736, 0.48950116924803444, 0.373870547461713, 0.008503203117404878, 0.31143953555235676], [1.6628262556002826, 1.0088246492480346, 1.1638294274617131, 1.267190243117405, 0.7935037955523567], [1.3287395256002825, 1.2891705807519656, 1.249448917461713, 0.2336232368825951, 1.0610335355523568], [1.7556853343997174, 0.6412940907519655, 0.21649666253828695, 1.4284346968825952, 1.0931518944476433], [1.5929877443997174, 1.5183983092480342, 1.397124362538287, 1.0324911431174049, 1.0123126644476432], [0.5520534056002826, 0.4145832507519656, 0.718732302538287, 1.121397813117405, 0.01881108444764329], [1.3667611656002827, 0.4832273807519656, 0.24994050746171304, 0.9108220468825952, 1.5383407855523568], [0.34190044439971734, 1.1575776692480346, 1.737289287461713, 0.11787593688259512, 0.31736193555235676], [1.5038989743997173, 0.5252725407519656, 0.630977217461713, 1.1277273631174047, 0.6798216344476433], [0.47681157439971733, 0.7808083507519656, 0.748072442538287, 0.6202313368825951, 0.6684586944476433], [1.5769009556002826, 1.2885272892480346, 1.194140392538287, 1.261622946882595, 0.4689016155523567], [1.1893264756002826, 0.5878914192480345, 0.783727792538287, 1.1406610531174048, 1.5637652855523567], [1.1369202243997174, 1.5407232007519656, 1.267742587461713, 0.656439413117405, 0.002351894447643277], [1.4131272143997173, 0.9174348292480344, 1.419458067461713, 1.1075605768825951, 1.3530470944476434], [0.4544064156002826, 0.13577006924803436, 0.634960077461713, 0.0845250368825951, 0.23455662444764327], [2.1975029856002823, 0.9525950207519656, 1.201012802538287, 1.7186754231174048, 1.1200421355523569], [0.3916728456002826, 1.0192106592480346, 1.554655842538287, 0.967948216882595, 0.7755321255523568], [1.1422359543997174, 1.2875782192480343, 0.06525295253828695, 1.419791946882595, 0.22225022555235668], [1.7376854143997176, 1.3345899807519657, 1.4258589874617131, 0.7287663631174048, 1.2634571444476432], [0.5621395956002826, 0.5419862692480344, 0.6543320074617129, 0.7961096131174048, 0.6280628544476433], [1.3347245956002824, 0.7680299892480343, 0.778413492538287, 1.8695298368825952, 0.7551204855523568], [0.17437012439971736, 0.7242366007519656, 1.807396212538287, 0.516741973117405, 0.7397343855523568], [1.7934006443997172, 0.2579327892480344, 0.664252592538287, 1.0049008231174048, 0.029727014447643252], [0.43139561439971735, 1.2876970992480343, 0.46361850746171307, 0.6411079768825951, 0.5277590744476433], [2.0742122856002827, 0.2760220907519656, 1.315594607461713, 0.753268726882595, 0.5615034144476433], [1.5115974256002827, 0.10449473075196558, 0.480465067461713, 0.7830354531174049, 1.3065148655523569], [1.2903560343997174, 0.9261471192480345, 1.216884752538287, 0.654951533117405, 0.5363363955523568], [1.4454765643997174, 0.00632760075196559, 1.600625302538287, 1.873814326882595, 0.6982994044476433], [0.19405081439971736, 1.0609725507519656, 0.160052757461713, 0.04700992311740487, 0.8347724344476433], [1.7545007956002827, 0.9337380392480344, 1.367792417461713, 1.812871213117405, 0.2280390844476433]]            [[0.09614286439971736, 0.48950116924803444, 0.373870547461713, 0.008503203117404878, 0.31143953555235676], [1.6628262556002826, 1.0088246492480346, 1.1638294274617131, 1.267190243117405, 0.7935037955523567], [1.3287395256002825, 1.2891705807519656, 1.249448917461713, 0.2336232368825951, 1.0610335355523568], [1.7556853343997174, 0.6412940907519655, 0.21649666253828695, 1.4284346968825952, 1.0931518944476433], [1.5929877443997174, 1.5183983092480342, 1.397124362538287, 1.0324911431174049, 1.0123126644476432], [0.5520534056002826, 0.4145832507519656, 0.718732302538287, 1.121397813117405, 0.01881108444764329], [1.3667611656002827, 0.4832273807519656, 0.24994050746171304, 0.9108220468825952, 1.5383407855523568], [0.34190044439971734, 1.1575776692480346, 1.737289287461713, 0.11787593688259512, 0.31736193555235676], [1.5038989743997173, 0.5252725407519656, 0.630977217461713, 1.1277273631174047, 0.6798216344476433], [0.47681157439971733, 0.7808083507519656, 0.748072442538287, 0.6202313368825951, 0.6684586944476433], [1.5769009556002826, 1.2885272892480346, 1.194140392538287, 1.261622946882595, 0.4689016155523567], [1.1893264756002826, 0.5878914192480345, 0.783727792538287, 1.1406610531174048, 1.5637652855523567], [1.1369202243997174, 1.5407232007519656, 1.267742587461713, 0.656439413117405, 0.002351894447643277], [1.4131272143997173, 0.9174348292480344, 1.419458067461713, 1.1075605768825951, 1.3530470944476434], [0.4544064156002826, 0.13577006924803436, 0.634960077461713, 0.0845250368825951, 0.23455662444764327], [2.1975029856002823, 0.9525950207519656, 1.201012802538287, 1.7186754231174048, 1.1200421355523569], [0.3916728456002826, 1.0192106592480346, 1.554655842538287, 0.967948216882595, 0.7755321255523568], [1.1422359543997174, 1.2875782192480343, 0.06525295253828695, 1.419791946882595, 0.22225022555235668], [1.7376854143997176, 1.3345899807519657, 1.4258589874617131, 0.7287663631174048, 1.2634571444476432], [0.5621395956002826, 0.5419862692480344, 0.6543320074617129, 0.7961096131174048, 0.6280628544476433], [1.3347245956002824, 0.7680299892480343, 0.778413492538287, 1.8695298368825952, 0.7551204855523568], [0.17437012439971736, 0.7242366007519656, 1.807396212538287, 0.516741973117405, 0.7397343855523568], [1.7934006443997172, 0.2579327892480344, 0.664252592538287, 1.0049008231174048, 0.029727014447643252], [0.43139561439971735, 1.2876970992480343, 0.46361850746171307, 0.6411079768825951, 0.5277590744476433], [2.0742122856002827, 0.2760220907519656, 1.315594607461713, 0.753268726882595, 0.5615034144476433], [1.5115974256002827, 0.10449473075196558, 0.480465067461713, 0.7830354531174049, 1.3065148655523569], [1.2903560343997174, 0.9261471192480345, 1.216884752538287, 0.654951533117405, 0.5363363955523568], [1.4454765643997174, 0.00632760075196559, 1.600625302538287, 1.873814326882595, 0.6982994044476433], [0.19405081439971736, 1.0609725507519656, 0.160052757461713, 0.04700992311740487, 0.8347724344476433], [1.7545007956002827, 0.9337380392480344, 1.367792417461713, 1.812871213117405, 0.2280390844476433]]            0                [5.785899315141023, 6.112693964697405, 5.323071833623729, 6.262155664531244, 5.460748453596229]      [2.273516919134873, 0.9725946717733077, 2.7124008156297394, 1.958416710149101, 1.8575752948651478, 2.7477744925001577, 2.451803650061749, 2.575763386138763, 0.9388811923770288, 1.1775424742069462, 1.5205970627013137, 2.1021239195573647, 2.4890336324854467, 1.8600910694417756, 2.364396854008327, 1.9366983676115446, 2.403437856031025, 3.3280311812772574, 2.5802738075013645, 1.3577417853993505, 2.492383508851588, 2.8323820074223054, 2.3562083888399057, 2.099517345026127, 2.9669712288270174, 2.526035010686918, 1.2169226290489261, 3.5567672404003434, 2.4899848296902465, 2.5295263397882803]  0\n",
      "[[0.0884883156002827, 0.07063476075196556, 0.266123502538287, 0.47463150311740493, 0.4990571355523567], [2.2718835456002826, 1.6328831992480342, 1.614056017461713, 1.6815105331174047, 1.4581700555523567], [0.8369307856002827, 0.9065040807519655, 0.9987400974617131, 0.1482009768825951, 0.8668518255523567], [1.1949946443997175, 0.4910334607519656, 0.07631382946171306, 1.223837906882595, 0.43266302444764326], [1.3192079843997173, 1.7832146192480343, 1.5710279125382869, 1.410097513117405, 0.6309844344476433], [0.8193035456002827, 0.9765986007519656, 0.883209013538287, 0.6417197731174049, 0.5471089755523568], [2.0123260856002827, 1.0793913507519655, 0.504174942461713, 1.8460075168825951, 0.9627545855523567], [0.27696274560028267, 1.4255270992480344, 1.060420437461713, 0.4418998731174049, 0.7799507655523568], [1.8431927543997175, 0.2815222207519656, 0.6800240974617131, 1.5226152931174048, 1.2070220544476433], [0.18561511439971737, 0.8740931107519656, 0.8212208015382869, 0.9985771268825951, 0.6929284644476432], [1.6794923356002824, 0.7351287592480343, 1.339172686538287, 0.6275045968825951, 0.5989560555523568], [0.9509935056002826, 0.33053319924803437, 0.12080527953828696, 1.3847933231174048, 1.1758626055523569], [1.1549332143997173, 0.9869720307519656, 1.570786617461713, 0.7903310531174048, 0.0733285055523567], [1.4708340543997172, 0.8473356392480343, 1.121864227461713, 0.9129530668825951, 0.5218806244476433], [0.2275698256002826, 0.9163115392480344, 0.022894580538286968, 0.5852356331174049, 0.7662445944476433], [1.7339388856002826, 1.0215988607519657, 0.6774974855382869, 0.9155368931174048, 0.5645091155523567], [0.8529083356002826, 0.3420164392480344, 0.8472016535382869, 0.2085120868825951, 1.3579162955523567], [1.0077172943997175, 0.8741924992480344, 0.5257979504617131, 0.5612330568825951, 0.1386038755523567], [1.5769765743997173, 1.4870189507519656, 1.030598837461713, 0.7877084231174047, 1.1128121144476433], [0.5349314656002826, 0.3104901192480344, 1.229515027461713, 0.4450346931174049, 0.17202525444764327], [1.4241354556002825, 0.6767328192480343, 0.46969313003828694, 1.8257159968825951, 1.4281233155523567], [6.861837565600283, 0.9501572207519656, 15.432573782538286, 7.336008376882595, 22.894529704447645], [28.264778355600285, 0.19318596924803444, 2.0623843074617128, 29.695744363117406, 2.4230219344476436], [3.2665079956002825, 28.328512329248035, 13.553396917461713, 13.267082823117406, 10.148388834447642], [40.779848255600285, 8.232048309248036, 30.313882482538286, 9.081153633117406, 4.154358435552357], [25.372075795600285, 4.915530200751966, 26.467967282538286, 15.424544666882595, 18.273641795552354], [3.651732775600282, 29.020194400751965, 6.3479309274617135, 12.708033033117406, 23.466041205552354], [18.636782464399715, 5.861407769248034, 9.662085172538287, 11.129235933117405, 4.682607624447643], [7.465648895600283, 2.676691169248034, 10.845372817461714, 9.159178856882594, 9.767154555552358], [31.835125234399715, 21.776769180751966, 33.04349221746171, 19.431650343117404, 4.514582384447643]]                    [[0.0884883156002827, 0.07063476075196556, 0.266123502538287, 0.47463150311740493, 0.4990571355523567], [2.2718835456002826, 1.6328831992480342, 1.614056017461713, 1.6815105331174047, 1.4581700555523567], [0.8369307856002827, 0.9065040807519655, 0.9987400974617131, 0.1482009768825951, 0.8668518255523567], [1.1949946443997175, 0.4910334607519656, 0.07631382946171306, 1.223837906882595, 0.43266302444764326], [1.3192079843997173, 1.7832146192480343, 1.5710279125382869, 1.410097513117405, 0.6309844344476433], [0.8193035456002827, 0.9765986007519656, 0.883209013538287, 0.6417197731174049, 0.5471089755523568], [2.0123260856002827, 1.0793913507519655, 0.504174942461713, 1.8460075168825951, 0.9627545855523567], [0.27696274560028267, 1.4255270992480344, 1.060420437461713, 0.4418998731174049, 0.7799507655523568], [1.8431927543997175, 0.2815222207519656, 0.6800240974617131, 1.5226152931174048, 1.2070220544476433], [0.18561511439971737, 0.8740931107519656, 0.8212208015382869, 0.9985771268825951, 0.6929284644476432], [1.6794923356002824, 0.7351287592480343, 1.339172686538287, 0.6275045968825951, 0.5989560555523568], [0.9509935056002826, 0.33053319924803437, 0.12080527953828696, 1.3847933231174048, 1.1758626055523569], [1.1549332143997173, 0.9869720307519656, 1.570786617461713, 0.7903310531174048, 0.0733285055523567], [1.4708340543997172, 0.8473356392480343, 1.121864227461713, 0.9129530668825951, 0.5218806244476433], [0.2275698256002826, 0.9163115392480344, 0.022894580538286968, 0.5852356331174049, 0.7662445944476433], [1.7339388856002826, 1.0215988607519657, 0.6774974855382869, 0.9155368931174048, 0.5645091155523567], [0.8529083356002826, 0.3420164392480344, 0.8472016535382869, 0.2085120868825951, 1.3579162955523567], [1.0077172943997175, 0.8741924992480344, 0.5257979504617131, 0.5612330568825951, 0.1386038755523567], [1.5769765743997173, 1.4870189507519656, 1.030598837461713, 0.7877084231174047, 1.1128121144476433], [0.5349314656002826, 0.3104901192480344, 1.229515027461713, 0.4450346931174049, 0.17202525444764327], [1.4241354556002825, 0.6767328192480343, 0.46969313003828694, 1.8257159968825951, 1.4281233155523567], [6.861837565600283, 0.9501572207519656, 15.432573782538286, 7.336008376882595, 22.894529704447645], [28.264778355600285, 0.19318596924803444, 2.0623843074617128, 29.695744363117406, 2.4230219344476436], [3.2665079956002825, 28.328512329248035, 13.553396917461713, 13.267082823117406, 10.148388834447642], [40.779848255600285, 8.232048309248036, 30.313882482538286, 9.081153633117406, 4.154358435552357], [25.372075795600285, 4.915530200751966, 26.467967282538286, 15.424544666882595, 18.273641795552354], [3.651732775600282, 29.020194400751965, 6.3479309274617135, 12.708033033117406, 23.466041205552354], [18.636782464399715, 5.861407769248034, 9.662085172538287, 11.129235933117405, 4.682607624447643], [7.465648895600283, 2.676691169248034, 10.845372817461714, 9.159178856882594, 9.767154555552358], [31.835125234399715, 21.776769180751966, 33.04349221746171, 19.431650343117404, 4.514582384447643]]                    1                [190.88561237498786, 143.8358673122165, 185.47215377566658, 147.81876375487616, 131.3884620500265]   [2.5437602951508884, 2.9872149379707706, 1.8842137045243732, 2.0989985268468896, 2.562872168549497, 0.8084220269340526, 2.30664565948502, 1.9452889778338394, 1.9917804001869372, 2.4595803566397807, 2.111459703199128, 2.538586207294843, 2.0538066788143645, 0.9412467013405316, 2.4480745041877205, 1.6468998362576583, 2.739592777914377, 1.7879519381713416, 2.1234432902157923, 2.226315968671995, 2.702671145380854, 62.840766454384415, 57.84660324943705, 68.8058363259548, 94.35241969777033, 74.71190600208215, 81.09387436432492, 33.210186446634076, 32.1771126331211, 82.63474877227391]          1\n",
      "[[0.13068354439971736, 0.4569472892480344, 0.08041841746171308, 0.0056671131174049205, 0.2687971264476433], [1.5261071356002827, 1.5348035592480342, 1.655736737461713, 1.025646283117405, 1.0926253155523569], [1.3056853656002825, 0.7117410307519656, 0.874772287461713, 0.5980229868825951, 0.8272351055523568], [1.0319333143997174, 0.05099612924803443, 0.7085140925382869, 0.6149735268825951, 0.4083519518476433], [1.6844316443997172, 0.8608034592480344, 1.4356461925382868, 1.2396255131174048, 1.1056539684476432], [1.0517377556002825, 0.6845753107519656, 0.40425382253828696, 1.080169263117405, 0.08476488344764327], [1.9479357156002823, 1.0992594007519656, 0.981372727461713, 1.6233509568825952, 1.7261472355523566], [0.24301683439971736, 0.9971191192480343, 1.103324417461713, 0.3801552868825951, 0.8650964355523567], [1.5993738443997172, 0.5324592007519656, 0.330955907461713, 1.423303453117405, 0.6006213844476432], [0.8862952043997174, 1.2427947107519657, 0.6582455825382869, 0.9602832768825951, 1.0217811344476433], [1.9573301256002824, 0.7386745092480343, 0.9338578725382869, 1.406159486882595, 0.19058507855235668], [1.5546306456002825, 0.5624396692480345, 0.17919409253828694, 1.3422715731174049, 1.6293811755523568], [0.9497520043997174, 1.0680176307519655, 0.6123616474617131, 0.09474216311740485, 0.2329995924476433], [2.104550954399717, 0.9586703892480345, 1.411521497461713, 1.2671792268825952, 1.0750449814476433], [0.6524207056002825, 0.9612339492480345, 0.583333107461713, 0.3138726268825951, 0.6546432624476433], [2.2949719156002826, 1.2925700007519656, 1.2283081125382869, 1.228519553117405, 0.5031385895523568], [1.1825662656002827, 0.5026487092480344, 1.539969842538287, 0.6407484568825951, 1.4654340955523568], [1.4140134343997173, 0.4547821892480344, 0.665954587461713, 0.9922552868825951, 0.3203757485523567], [1.5159835643997175, 0.6655120007519656, 1.193614997461713, 1.0607791231174049, 1.0230707274476434], [0.7854022356002827, 0.17208986075196558, 0.799829867461713, 0.9073330231174048, 0.7530567094476432], [1.3868411956002826, 0.9041814092480344, 0.791273102538287, 1.7783963468825952, 1.4250539655523569], [0.9220465256002827, 4.587931770751966, 12.355560442538287, 9.827070863117406, 11.016934825552356], [20.257308315600284, 0.5480946892480344, 0.6342231374617131, 26.513587686882595, 1.0325783955523569], [1.5622380143997172, 29.408115550751965, 20.514607947461712, 0.8403860868825951, 18.453461674447645], [28.822911274399715, 6.645922029248034, 24.561550392538287, 8.733758293117406, 11.168909625552358], [15.69878380560028, 1.8256791007519655, 21.121161367461713, 16.876401216882595, 23.935639725552356], [6.959232585600283, 14.072160969248035, 3.2502673774617135, 26.344878386882595, 14.638105474447643], [11.704216505600282, 7.111286599248034, 19.916010247461713, 6.608606893117405, 1.0401358755523569], [14.709656435600282, 6.480244329248034, 6.028448987461713, 8.576784656882595, 14.875143974447642], [32.48679547560028, 13.557363989248035, 12.987117537461714, 27.043976766882594, 6.971462525552357]]                       [[0.13068354439971736, 0.4569472892480344, 0.08041841746171308, 0.0056671131174049205, 0.2687971264476433], [1.5261071356002827, 1.5348035592480342, 1.655736737461713, 1.025646283117405, 1.0926253155523569], [1.3056853656002825, 0.7117410307519656, 0.874772287461713, 0.5980229868825951, 0.8272351055523568], [1.0319333143997174, 0.05099612924803443, 0.7085140925382869, 0.6149735268825951, 0.4083519518476433], [1.6844316443997172, 0.8608034592480344, 1.4356461925382868, 1.2396255131174048, 1.1056539684476432], [1.0517377556002825, 0.6845753107519656, 0.40425382253828696, 1.080169263117405, 0.08476488344764327], [1.9479357156002823, 1.0992594007519656, 0.981372727461713, 1.6233509568825952, 1.7261472355523566], [0.24301683439971736, 0.9971191192480343, 1.103324417461713, 0.3801552868825951, 0.8650964355523567], [1.5993738443997172, 0.5324592007519656, 0.330955907461713, 1.423303453117405, 0.6006213844476432], [0.8862952043997174, 1.2427947107519657, 0.6582455825382869, 0.9602832768825951, 1.0217811344476433], [1.9573301256002824, 0.7386745092480343, 0.9338578725382869, 1.406159486882595, 0.19058507855235668], [1.5546306456002825, 0.5624396692480345, 0.17919409253828694, 1.3422715731174049, 1.6293811755523568], [0.9497520043997174, 1.0680176307519655, 0.6123616474617131, 0.09474216311740485, 0.2329995924476433], [2.104550954399717, 0.9586703892480345, 1.411521497461713, 1.2671792268825952, 1.0750449814476433], [0.6524207056002825, 0.9612339492480345, 0.583333107461713, 0.3138726268825951, 0.6546432624476433], [2.2949719156002826, 1.2925700007519656, 1.2283081125382869, 1.228519553117405, 0.5031385895523568], [1.1825662656002827, 0.5026487092480344, 1.539969842538287, 0.6407484568825951, 1.4654340955523568], [1.4140134343997173, 0.4547821892480344, 0.665954587461713, 0.9922552868825951, 0.3203757485523567], [1.5159835643997175, 0.6655120007519656, 1.193614997461713, 1.0607791231174049, 1.0230707274476434], [0.7854022356002827, 0.17208986075196558, 0.799829867461713, 0.9073330231174048, 0.7530567094476432], [1.3868411956002826, 0.9041814092480344, 0.791273102538287, 1.7783963468825952, 1.4250539655523569], [0.9220465256002827, 4.587931770751966, 12.355560442538287, 9.827070863117406, 11.016934825552356], [20.257308315600284, 0.5480946892480344, 0.6342231374617131, 26.513587686882595, 1.0325783955523569], [1.5622380143997172, 29.408115550751965, 20.514607947461712, 0.8403860868825951, 18.453461674447645], [28.822911274399715, 6.645922029248034, 24.561550392538287, 8.733758293117406, 11.168909625552358], [15.69878380560028, 1.8256791007519655, 21.121161367461713, 16.876401216882595, 23.935639725552356], [6.959232585600283, 14.072160969248035, 3.2502673774617135, 26.344878386882595, 14.638105474447643], [11.704216505600282, 7.111286599248034, 19.916010247461713, 6.608606893117405, 1.0401358755523569], [14.709656435600282, 6.480244329248034, 6.028448987461713, 8.576784656882595, 14.875143974447642], [32.48679547560028, 13.557363989248035, 12.987117537461714, 27.043976766882594, 6.971462525552357]]                       1                [157.63749396998372, 117.5391274757657, 151.2544157894439, 161.89781118429798, 131.11020275155346]   [2.5718605064614497, 2.1183007494474873, 1.2691079068905156, 1.871173920304094, 1.5928421773884942, 2.083429173548623, 2.6253368503364816, 1.6841487933594446, 1.6935272153768353, 1.5126613415443901, 1.9202429528242506, 2.641409833882515, 2.4315748610319123, 2.00905762362368, 1.4286909790625688, 2.420843512053457, 2.8762636361597322, 1.3282051540708333, 1.2270885934590106, 1.6904696854537724, 2.494664113140997, 40.900893084244174, 52.65554412568025, 75.35475999008193, 71.98250657624786, 73.8480206277582, 72.94403514748838, 40.82558319406585, 40.3924745379544, 63.166481405433935]         1\n",
      "[[0.39535613439971734, 0.1710693367519656, 0.37785785253828696, 0.3424352268825951, 0.31049004555235676], [1.6909446156002828, 1.3485424892480342, 1.471183217461713, 1.614676343117405, 0.7604944555523567], [0.4208031556002827, 0.3880169340519656, 1.334325417461713, 0.9947049768825951, 0.5813539855523566], [0.9170439143997173, 0.4960419819519656, 0.47208089253828694, 1.1518894768825951, 0.8274525244476433], [1.6082090743997175, 1.7773609292480343, 0.9929383625382869, 0.7056504831174049, 0.9814147644476432], [1.1124912256002828, 0.8874682037519657, 0.6368359925382869, 0.19095291311740487, 0.0550484144476433], [2.1698192856002825, 0.6664102867519656, 0.9567191474617129, 1.1388847468825951, 1.0683089055523567], [0.37187667439971733, 1.2925680692480346, 1.1346041974617131, 0.3484095068825951, 0.1880950855523567], [1.8526428543997175, 0.33454267785196556, 0.7405425474617131, 1.3275307331174049, 1.1005086544476432], [0.46919330439971735, 0.6559977357519655, 0.48085054253828696, 0.6069292068825951, 0.46939418444764325], [1.1733628156002824, 1.3250477692480342, 0.918036842538287, 0.5661787568825951, 0.4708081255523567], [1.8811977056002824, 0.5374011872480344, 0.39924789253828696, 1.4190696331174049, 0.9954456255523567], [1.1269569643997173, 0.7064687667519656, 1.2140301274617131, 0.7923654331174048, 0.23718108555235667], [1.2215537243997172, 1.4202801092480346, 0.982194007461713, 1.6893508968825952, 1.1975114144476433], [0.1956594456002826, 0.5029566212480344, 0.2705944174617131, 0.5655839931174049, 0.8230020944476433], [1.6146931256002826, 1.0792420027519656, 1.570009222538287, 1.0930995631174047, 0.7049705755523568], [1.1461462356002827, 0.8735310192480344, 1.015215042538287, 0.7089167668825951, 0.8725264555523569], [0.9810603243997174, 1.0590080692480344, 0.716900837461713, 1.162972186882595, 0.4594958744476433], [1.4053273743997172, 0.8805229587519656, 1.8726569074617132, 1.3302693831174048, 1.3610333844476432], [1.3739871956002827, 0.2379613907519656, 1.289369197461713, 0.2532631931174049, 0.4398007444476433], [1.9430818756002823, 0.8863093092480344, 0.7258716825382869, 0.9349570268825951, 0.5569262955523566], [9.395273994399718, 8.911075629248035, 13.768180952538287, 11.155682293117406, 22.684763024447644], [11.372952215600282, 10.056635289248035, 2.185507627461713, 25.860374276882595, 6.469085775552357], [6.636534684399717, 25.478047910751965, 17.934934967461714, 3.8596497031174044, 21.457427025552356], [22.954739455600283, 0.09471938275196556, 13.889532452538287, 11.305520636882594, 7.133639594447643], [26.881333774399717, 4.881479060751966, 13.027926512538286, 13.459191806882595, 24.088831564447645], [2.2478766443997173, 10.511153289248035, 14.041710687461713, 14.567312903117406, 9.827684344447643], [17.431801064399718, 3.2968657792480345, 9.458788287461713, 12.661154116882594, 3.911838845552357], [11.847900894399718, 5.527445979248034, 0.5361710125382869, 8.496050676882595, 7.977275165552356], [25.993786575600282, 18.507061810751964, 16.958780287461714, 41.0559732868826, 2.7275626644476434]]                 [[0.39535613439971734, 0.1710693367519656, 0.37785785253828696, 0.3424352268825951, 0.31049004555235676], [1.6909446156002828, 1.3485424892480342, 1.471183217461713, 1.614676343117405, 0.7604944555523567], [0.4208031556002827, 0.3880169340519656, 1.334325417461713, 0.9947049768825951, 0.5813539855523566], [0.9170439143997173, 0.4960419819519656, 0.47208089253828694, 1.1518894768825951, 0.8274525244476433], [1.6082090743997175, 1.7773609292480343, 0.9929383625382869, 0.7056504831174049, 0.9814147644476432], [1.1124912256002828, 0.8874682037519657, 0.6368359925382869, 0.19095291311740487, 0.0550484144476433], [2.1698192856002825, 0.6664102867519656, 0.9567191474617129, 1.1388847468825951, 1.0683089055523567], [0.37187667439971733, 1.2925680692480346, 1.1346041974617131, 0.3484095068825951, 0.1880950855523567], [1.8526428543997175, 0.33454267785196556, 0.7405425474617131, 1.3275307331174049, 1.1005086544476432], [0.46919330439971735, 0.6559977357519655, 0.48085054253828696, 0.6069292068825951, 0.46939418444764325], [1.1733628156002824, 1.3250477692480342, 0.918036842538287, 0.5661787568825951, 0.4708081255523567], [1.8811977056002824, 0.5374011872480344, 0.39924789253828696, 1.4190696331174049, 0.9954456255523567], [1.1269569643997173, 0.7064687667519656, 1.2140301274617131, 0.7923654331174048, 0.23718108555235667], [1.2215537243997172, 1.4202801092480346, 0.982194007461713, 1.6893508968825952, 1.1975114144476433], [0.1956594456002826, 0.5029566212480344, 0.2705944174617131, 0.5655839931174049, 0.8230020944476433], [1.6146931256002826, 1.0792420027519656, 1.570009222538287, 1.0930995631174047, 0.7049705755523568], [1.1461462356002827, 0.8735310192480344, 1.015215042538287, 0.7089167668825951, 0.8725264555523569], [0.9810603243997174, 1.0590080692480344, 0.716900837461713, 1.162972186882595, 0.4594958744476433], [1.4053273743997172, 0.8805229587519656, 1.8726569074617132, 1.3302693831174048, 1.3610333844476432], [1.3739871956002827, 0.2379613907519656, 1.289369197461713, 0.2532631931174049, 0.4398007444476433], [1.9430818756002823, 0.8863093092480344, 0.7258716825382869, 0.9349570268825951, 0.5569262955523566], [9.395273994399718, 8.911075629248035, 13.768180952538287, 11.155682293117406, 22.684763024447644], [11.372952215600282, 10.056635289248035, 2.185507627461713, 25.860374276882595, 6.469085775552357], [6.636534684399717, 25.478047910751965, 17.934934967461714, 3.8596497031174044, 21.457427025552356], [22.954739455600283, 0.09471938275196556, 13.889532452538287, 11.305520636882594, 7.133639594447643], [26.881333774399717, 4.881479060751966, 13.027926512538286, 13.459191806882595, 24.088831564447645], [2.2478766443997173, 10.511153289248035, 14.041710687461713, 14.567312903117406, 9.827684344447643], [17.431801064399718, 3.2968657792480345, 9.458788287461713, 12.661154116882594, 3.911838845552357], [11.847900894399718, 5.527445979248034, 0.5361710125382869, 8.496050676882595, 7.977275165552356], [25.993786575600282, 18.507061810751964, 16.958780287461714, 41.0559732868826, 2.7275626644476434]]                 1                [156.3306580242613, 117.70996977780395, 117.99835727308069, 173.26587106407726, 144.64588455590766]  [2.11432387723262, 1.9650647114937052, 2.5584905102489626, 1.4937367269700137, 2.6989892401007554, 2.4983857482943903, 2.132341884792325, 2.091793208694163, 1.745834696622925, 1.4998222548740354, 1.6547490789240085, 1.7269099528236305, 1.3764376345213187, 2.578813353869135, 2.0684256588956247, 1.5096627987692028, 0.7642568708001646, 1.573763695444833, 2.65472935341281, 2.908236039124681, 1.9102890906317236, 59.409872876007455, 60.759973428464875, 72.4564576526633, 46.01351623522314, 71.55853126224658, 49.777423523444334, 31.060955215218026, 25.603697793937783, 94.5647217978172]         1\n",
      "[[0.3819885043997174, 0.3743638192480344, 0.06516781746171307, 0.4603033168825951, 0.28932940444764327], [2.3484592556002823, 1.3911367392480343, 1.294403597461713, 1.2653239831174048, 1.4055619455523567], [0.7669854356002827, 0.4087678807519656, 0.717540687461713, 0.13660900688259509, 1.1270667955523568], [1.0224844943997173, 0.3354700907519656, 0.11502922253828696, 0.5885728568825951, 0.23394572444764328], [1.7554375143997172, 1.3451950092480343, 1.380509442538287, 0.9236977131174049, 0.6056431944476433], [0.5112486656002826, 0.8008434407519656, 1.053086212538287, 0.3366893831174049, 0.032234444447643285], [1.3751252156002827, 0.7829758107519655, 1.017118907461713, 1.1710254068825952, 1.6275925455523568], [0.29994149439971735, 1.6825586492480342, 1.220846577461713, 0.47332821311740486, 0.36140315555235675], [1.9620365743997175, 0.4490404907519656, 0.507419237461713, 1.8816172231174049, 1.2975406944476433], [0.29637776439971736, 0.9324497007519655, 0.8421342525382869, 0.4527706968825951, 0.5001433644476433], [1.2338121356002825, 1.6796206092480341, 1.778765302538287, 0.8886521168825952, 1.0862367255523568], [1.7446158156002824, 0.21373894924803438, 0.617954302538287, 1.6883410031174049, 1.7205508155523568], [0.7005981643997173, 0.9387252107519656, 1.3703902074617131, 0.42208539311740495, 0.41251010555235673], [1.7556448443997175, 0.5657815092480344, 1.259998707461713, 1.2681502868825951, 0.9049637244476432], [0.2080361456002826, 0.5336868692480344, 0.636195787461713, 0.06099491688259512, 0.8585167344476432], [2.1879074756002823, 0.8613351207519656, 1.122490612538287, 1.8235783031174049, 0.41862471555235675], [1.1182330356002828, 0.7032331892480345, 0.6740362325382869, 0.6943314368825951, 1.3168554555523568], [0.9911847543997173, 1.1989938092480346, 0.04200646253828694, 0.7342335868825951, 0.4128259955523567], [1.1485701443997174, 1.2612838307519656, 0.983607717461713, 1.0806231531174049, 1.2365128744476432], [0.7294650956002827, 0.5806270392480344, 0.8974233074617131, 0.8856514031174048, 0.5307378044476433], [2.0810674556002824, 0.8852983192480345, 0.06560416253828694, 1.060747216882595, 0.7173139555523569], [0.08109546439971738, 0.8170790407519656, 0.8512371925382869, 0.2727720368825951, 0.7288387055523569], [2.2074558743997175, 0.6130885707519655, 0.22412619253828694, 1.629205263117405, 0.4381877544476433], [0.37502093439971734, 0.9053639892480344, 0.7436990874617131, 0.5251599968825951, 0.5276985544476432], [1.8831928656002823, 0.2602635907519656, 1.793609207461713, 1.3329047468825952, 0.04944563444764327], [1.4018672856002827, 0.7752275607519656, 0.104726977461713, 1.4752754631174048, 1.0991230755523569], [0.5481176943997174, 0.9246825492480345, 0.616922502538287, 0.7756628631174047, 1.2835295255523569], [1.9399975343997173, 0.4385186007519656, 1.139356672538287, 1.6790865868825953, 1.0289149044476433], [0.6661389156002827, 0.6850835707519656, 0.08341069746171303, 0.1766381468825951, 1.1315403644476432], [2.2919235156002826, 1.1399931192480346, 1.672446757461713, 0.9918231731174048, 0.5619590555523568]]  [[0.3819885043997174, 0.3743638192480344, 0.06516781746171307, 0.4603033168825951, 0.28932940444764327], [2.3484592556002823, 1.3911367392480343, 1.294403597461713, 1.2653239831174048, 1.4055619455523567], [0.7669854356002827, 0.4087678807519656, 0.717540687461713, 0.13660900688259509, 1.1270667955523568], [1.0224844943997173, 0.3354700907519656, 0.11502922253828696, 0.5885728568825951, 0.23394572444764328], [1.7554375143997172, 1.3451950092480343, 1.380509442538287, 0.9236977131174049, 0.6056431944476433], [0.5112486656002826, 0.8008434407519656, 1.053086212538287, 0.3366893831174049, 0.032234444447643285], [1.3751252156002827, 0.7829758107519655, 1.017118907461713, 1.1710254068825952, 1.6275925455523568], [0.29994149439971735, 1.6825586492480342, 1.220846577461713, 0.47332821311740486, 0.36140315555235675], [1.9620365743997175, 0.4490404907519656, 0.507419237461713, 1.8816172231174049, 1.2975406944476433], [0.29637776439971736, 0.9324497007519655, 0.8421342525382869, 0.4527706968825951, 0.5001433644476433], [1.2338121356002825, 1.6796206092480341, 1.778765302538287, 0.8886521168825952, 1.0862367255523568], [1.7446158156002824, 0.21373894924803438, 0.617954302538287, 1.6883410031174049, 1.7205508155523568], [0.7005981643997173, 0.9387252107519656, 1.3703902074617131, 0.42208539311740495, 0.41251010555235673], [1.7556448443997175, 0.5657815092480344, 1.259998707461713, 1.2681502868825951, 0.9049637244476432], [0.2080361456002826, 0.5336868692480344, 0.636195787461713, 0.06099491688259512, 0.8585167344476432], [2.1879074756002823, 0.8613351207519656, 1.122490612538287, 1.8235783031174049, 0.41862471555235675], [1.1182330356002828, 0.7032331892480345, 0.6740362325382869, 0.6943314368825951, 1.3168554555523568], [0.9911847543997173, 1.1989938092480346, 0.04200646253828694, 0.7342335868825951, 0.4128259955523567], [1.1485701443997174, 1.2612838307519656, 0.983607717461713, 1.0806231531174049, 1.2365128744476432], [0.7294650956002827, 0.5806270392480344, 0.8974233074617131, 0.8856514031174048, 0.5307378044476433], [2.0810674556002824, 0.8852983192480345, 0.06560416253828694, 1.060747216882595, 0.7173139555523569], [0.08109546439971738, 0.8170790407519656, 0.8512371925382869, 0.2727720368825951, 0.7288387055523569], [2.2074558743997175, 0.6130885707519655, 0.22412619253828694, 1.629205263117405, 0.4381877544476433], [0.37502093439971734, 0.9053639892480344, 0.7436990874617131, 0.5251599968825951, 0.5276985544476432], [1.8831928656002823, 0.2602635907519656, 1.793609207461713, 1.3329047468825952, 0.04944563444764327], [1.4018672856002827, 0.7752275607519656, 0.104726977461713, 1.4752754631174048, 1.0991230755523569], [0.5481176943997174, 0.9246825492480345, 0.616922502538287, 0.7756628631174047, 1.2835295255523569], [1.9399975343997173, 0.4385186007519656, 1.139356672538287, 1.6790865868825953, 1.0289149044476433], [0.6661389156002827, 0.6850835707519656, 0.08341069746171303, 0.1766381468825951, 1.1315403644476432], [2.2919235156002826, 1.1399931192480346, 1.672446757461713, 0.9918231731174048, 0.5619590555523568]]  0                [6.0743239810051755, 5.192846251227752, 6.27468678345514, 5.484449397153093, 6.228086791344785]      [2.280806962409421, 2.90690488880856, 2.361899925591336, 2.111458370466081, 1.8821081829250477, 1.961046720111201, 2.1691402171650953, 2.529283895971018, 2.4257167793650876, 1.5128586629334575, 2.375035121823962, 2.998830715572549, 1.5598722524123945, 1.4535902998555907, 2.002637512939458, 2.1568213658274558, 1.6783206263628299, 2.5045774306134976, 1.5018886130108131, 1.1997320866920742, 2.7694333386337275, 1.7744624099649935, 2.527014190890087, 1.4060531299588566, 3.1487187843385227, 2.2293549622710107, 1.8350533191461647, 1.9276959267683154, 2.4939905760208445, 2.85941801064541]      0\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: The `gcloud ml-engine` commands have been renamed and will soon be removed. Please use `gcloud ai-platform` instead.\n",
      "WARNING: 2019-07-12 20:43:01.672482: I tensorflow/core/platform/cpu_feature_guard.cc:145] This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical operations:  AVX2 FMA\n",
      "To enable them in non-MKL-DNN operations, rebuild TensorFlow with the appropriate compiler flags.\n",
      "2019-07-12 20:43:01.683014: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:43:01.684740: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5643f34830d0 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:43:01.684768: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "2019-07-12 20:43:01.686903: I tensorflow/core/common_runtime/process_util.cc:115] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.\n",
      "WARNING: Logging before flag parsing goes to stderr.\n",
      "W0712 20:43:01.687238 140652459816384 deprecation.py:323] From /usr/lib/google-cloud-sdk/lib/third_party/ml_sdk/cloud/ml/prediction/frameworks/tf_prediction_lib.py:210: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function for importing SavedModels in Tensorflow 2.0.\n",
      "W0712 20:43:03.145060 140652459816384 deprecation.py:323] From /usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py:1276: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "2019-07-12 20:43:03.454702: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "model_dir=$(ls ${PWD}/trained_model/lstm_labeled/export/exporter | tail -1)\n",
    "gcloud ml-engine local predict \\\n",
    "  --model-dir=${PWD}/trained_model/lstm_labeled/export/exporter/${model_dir} \\\n",
    "  --json-instances=./test_sequences.json"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### PCA Autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_FEAT_ABS_RECON_ERR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                X_TIME_ABS_RECON_ERR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            FEAT_ANOM_FLAGS  MAHALANOBIS_DIST_FEAT                                                                                MAHALANOBIS_DIST_TIME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             TIME_ANOM_FLAGS\n",
      "[[0.16373820183734544, 0.3542266117383235, 0.4355817535193831, 0.054669573298224354, 0.40955906406765796], [0.1293657542684008, 0.1827617576725824, 0.2715684470574288, 0.08644414535777921, 0.07438152432553503], [0.5437437228620384, 0.8101394239937798, 1.7407919810760912, 0.5615498923394175, 0.012902838293615049], [0.012025497190085332, 0.2961070050216321, 0.6646215546365886, 0.10734823479201791, 0.3897156565278287], [0.06334951329607308, 1.4158652709938169, 1.3603194672386654, 1.3215562996633459, 0.2986053033642767], [0.39660328451634563, 0.2602381890074777, 0.40495991048983543, 0.8479539872452044, 0.43186976958173423], [0.1149081374289902, 0.02255911175507852, 1.4699305215386893, 0.8674259428047445, 0.08326371004946731], [0.1883424210562864, 0.5560622805232438, 0.09164427164111122, 1.2602427872323065, 0.38055302787300715], [0.33203673303475356, 0.38597762212079473, 0.29044251568920476, 0.3079666709267139, 0.11874520807249467], [0.10727963359657397, 0.3449275850222333, 0.15852272902316936, 0.13981343879400662, 0.10973085813959742], [0.26112464731271423, 1.5501890805782361, 0.46531961500585517, 0.6570472178278879, 0.1959982535510434], [0.5353864463618294, 0.07662395061473615, 0.9119952905868536, 0.6423770766788083, 0.494728367265611], [0.45670065681000904, 1.0954033677445776, 0.8447161279555756, 0.7244545789803754, 0.3600072872424451], [0.2429524926977915, 0.8800485101041939, 0.9388256738939763, 1.591793279995032, 0.007617385922773945], [0.5699718311676619, 0.7375525980772358, 0.21610770958794312, 0.31122579889169355, 0.6985028309295116], [0.17807181941431338, 1.3047460311357393, 1.077831654283884, 2.2997644338013483, 0.6617024820192953], [0.24319409961394522, 1.030488763902994, 0.3345693440796361, 0.01965665864120847, 0.5239383822307864], [0.6873592974864838, 1.1732300033758767, 0.37758952890503145, 0.883957653428454, 0.6502498658911844], [0.24507007754170607, 1.7286171745800005, 0.4639869405345184, 0.8182365510033611, 0.5762363837569536], [0.30548780675151854, 0.10123195825980259, 0.5051485682052667, 0.3234068745720049, 1.1066996862936018], [0.3388393784381547, 0.9902173097412601, 0.429683074733757, 1.3736484288540551, 0.0912677566678548], [0.9645500624254321, 0.022919643963252967, 0.8745825431042035, 1.030304022261462, 1.2770260797378445], [0.058295485787331236, 0.8235834714179104, 1.128336298093327, 1.605795834328053, 0.16912175026880738], [0.30289540605838405, 1.3626173250661862, 0.8035632235349046, 1.5295284033196963, 0.08221771297622821], [0.6497935943397899, 0.13400749209109464, 1.9961625418004814, 1.0071004396702894, 0.6794654074626061], [0.23899489597363488, 1.2226972251500867, 0.14304457573015883, 0.615906852087191, 0.510995866073676], [0.7479399142525872, 0.8064950723331707, 1.6175169726085112, 0.04990553071041354, 0.8328114528864548], [0.04983549883811236, 0.43498822068734283, 0.16454216987535905, 0.8124693364347801, 0.28902166067414903], [0.2862940057119884, 0.646089169128788, 0.203405764127073, 0.3692911993789811, 0.3545750459341984], [0.6592731719655704, 0.41543339305160265, 0.10034180920109757, 0.18524943330068758, 1.549389352893575]]  [[0.1729249045107869, 0.3801611767222136, 0.4030211410145257, 0.014692949818311107, 0.37411241882082724], [0.47149008331733566, 1.3482907447888262, 0.7862226970452417, 0.8846580694714556, 0.5997259955542591], [0.07635155912033742, 0.9317281081546562, 1.4758490221150717, 0.8434482950317854, 0.0907488549566654], [0.036283919471545634, 0.2826233032664571, 0.2094228120133142, 0.5477506353058643, 0.03544580831460831], [0.04745131357127663, 1.6307625241330355, 0.9164171137289052, 1.7216600164741915, 0.43710181609729215], [0.08224621381750141, 0.5942944942747547, 0.885413176927021, 0.4171745317684355, 0.12935924381752884], [0.0964959936790486, 0.44972556328162006, 0.6664453412739542, 1.6252070125225728, 0.1050201214925055], [0.27277542729234655, 1.393536073303297, 1.0190237648795992, 0.42532372269945684, 0.4593189817608837], [0.13362207481414945, 0.1720157353688644, 1.1977327263368374, 1.1532837248608163, 0.12219209012764431], [0.2483346562021015, 1.1879535442558253, 0.9863801194330131, 0.64307231204571, 0.19346984605600143], [0.13653345643483894, 1.017747664493183, 1.277692712630365, 1.401046768275437, 0.12539906033694526], [0.4903689094798138, 0.19685707142326084, 0.8274814700331674, 0.7207501932780553, 0.9014014622354681], [0.355133467954196, 0.886288563056266, 1.1885365782280435, 1.0400003989004147, 0.39065418520306355], [0.15156610380585978, 1.087590889119385, 1.4365498878049983, 1.1472617867488986, 0.26067530208957823], [0.3139437904123866, 0.8427682677665687, 0.35624388482028363, 0.4175172983753964, 0.790558590548364], [0.18810134674980072, 1.703237165713078, 1.7810859195328204, 1.6372436286474328, 0.45439897138446883], [0.20893705810616592, 0.6026253568987798, 0.9828115163158452, 0.6316716515090086, 0.6323360563628908], [0.3257851018160691, 1.1962261295833303, 0.5815469395226487, 0.6868791855501922, 0.6778904315586924], [0.17160294593154868, 1.311886376111304, 1.1756745243109297, 1.4653492740200522, 0.7271850870535521], [0.3586579297833382, 0.31851468839204805, 0.9204186098474431, 0.061250058483455466, 0.8413075917850716], [0.10822768729717858, 0.6474526987375665, 0.23315989072359394, 2.011355140851473, 0.214756016068958], [0.6049667782925536, 0.6810125310423875, 1.6686897519312185, 0.29666513522236854, 1.3521453585704897], [0.13138861979289462, 0.6839980621663786, 0.7530913052114587, 1.9376822751043956, 0.04279647144959697], [0.12375951361359117, 1.6407469089855375, 1.2560417720759354, 1.1289109308558616, 0.21423619114443132], [0.40006379669518677, 0.32823050671140813, 1.6251444748077561, 1.375447238019315, 0.6628171571091142], [0.46115216036162443, 0.8679795369906039, 0.05078495588149021, 0.7811222558298989, 0.7813473591110848], [0.5088319009681943, 1.0683174885522713, 1.2739987713781387, 0.37476634356787314, 1.0227542283722448], [0.3084159817373453, 0.5716527806998117, 1.0901061221425516, 1.6828785860348314, 0.10508434271625655], [0.2853360089837597, 1.035701978983373, 0.19125958039486624, 0.012685528818662924, 0.49696178329169827], [0.3943216266267058, 1.4528615352130994, 0.8768599809733509, 0.7127534340726664, 1.0983471253254273]]            0                [4.492165225483232, 5.925728806034316, 5.585922775356791, 6.454044446633134, 5.94465340680206]       [2.1946417128865154, 2.191082462281185, 1.7222515497374202, 2.2663024990465326, 3.151111026475872, 1.69187184759487, 1.7753724410159235, 1.6468076901829776, 2.103685750444875, 1.7185026237179812, 1.476564934172033, 2.3717720681568304, 1.549278025137391, 1.299975004234112, 1.8043086718248087, 2.740195415762323, 1.2981770760288147, 1.491269525122406, 2.5130721221064882, 2.327722231470522, 2.7048875628811535, 3.599131070651172, 2.247458355970372, 2.0764781191091473, 2.835313229248439, 2.3458066340278787, 2.2190809368238056, 2.695950541051843, 2.402259443391408, 2.671490322815947]           0\n",
      "[[0.3239943922469582, 0.209878586824551, 0.40664393865737214, 0.06735433092095196, 0.08635235748420039], [0.318935021709441, 0.10420873096826685, 0.3853263664440988, 0.506674028626845, 0.546430586023236], [0.12333201375132785, 0.5942222417767056, 1.4982573882083345, 0.8898864642218908, 0.1104651466260208], [0.33618985032273707, 0.03466496286629031, 0.1633400086214479, 0.3047817267483343, 0.5785945478968605], [0.4308296858240488, 1.6538082391184425, 2.0810029719939593, 0.6903245400187056, 0.4556432067660431], [0.4853786757097215, 0.440072671833553, 0.059764073420138064, 0.5979445325412129, 0.19456016360165845], [0.35646054473290345, 0.6944121075606593, 1.144724618238647, 1.203643380897883, 0.30345036789819174], [0.3702930104060169, 0.26517488367281417, 0.12884060453339502, 0.958574753271244, 0.2826071190373993], [0.17317115092946578, 0.48812159426567553, 0.17799359232880918, 0.6719686304966744, 0.16755293171913044], [0.04936301991871952, 0.11606090394894951, 0.49478169097109037, 0.4672185596088044, 0.411458783099439], [0.4187383439348923, 1.6746503983861936, 0.36120901696005236, 0.9449844882957424, 0.39512759297890954], [0.20524372519863365, 0.07000204696846615, 0.743455447410788, 1.2498897470365395, 0.08406437639916983], [0.1524392977347695, 1.3052400448738037, 1.0483779471149848, 0.7833828994215871, 0.7596806489690197], [0.029643805702217252, 0.6137092946113685, 1.3761982180723495, 1.252951198879214, 0.307891405144391], [0.2570436813014101, 0.25123233911493337, 0.4166965302216967, 0.2749089659929239, 0.9954083513720388], [0.5734168373918838, 0.8321639587426036, 0.47249787845999514, 1.9340127947408572, 0.3357863325351899], [0.6928804504164614, 0.9238642789242664, 0.5010326834861565, 0.002020456170916285, 0.7297539704602745], [0.6446774601720969, 1.1790726534496865, 0.09498532580576424, 1.3853658100273378, 0.7484750142172112], [0.6772618508371636, 1.5110930874832333, 0.4984331378731274, 0.6761337128714426, 0.2286749734463152], [0.5893329485788614, 0.19276332541609031, 0.018248581367358768, 0.3861612368125638, 0.41645402704331047], [0.2771267775166051, 1.3184703658675447, 0.5201374970627908, 1.1216837631993442, 0.3083257434495513], [0.4887423887780964, 0.007149306763392843, 0.8503384706251157, 0.8274021648256082, 0.8347775855419595], [0.07235008172017432, 0.04689013516413448, 0.5119403210559547, 1.1956842101381313, 0.31112981319196953], [0.7132448251886481, 1.0191432167473522, 0.17112903259809292, 1.1333646247643032, 0.7603521073465804], [0.3662138476005775, 0.2277163662568743, 1.8571858424166816, 0.44465792138383425, 0.9610181144239679], [0.18750471873745345, 1.0950773842567254, 0.029819161234992453, 1.1860024682531665, 0.10109195399104415], [1.0018427963411098, 0.7210155659303193, 1.7391307033535164, 0.12958355502060154, 1.0938949881679132], [0.552326720808829, 0.47025537012647617, 0.47124929516298947, 0.056861140945606126, 0.9968454204273458], [0.5417171194839628, 0.8660197978113282, 0.15392693716248262, 0.8003936073531396, 0.2704849539785992], [0.9785700150287476, 0.26416189790171685, 0.5261482056094825, 0.21277721379791203, 1.2822291508633326]]     [[0.0898579249077206, 0.18907746900419642, 0.42668390514429616, 0.08293687099001337, 0.2348831307924288], [0.15903679006752558, 1.2949896406482584, 0.6922418181324209, 1.469652257939351, 0.13440047080887363], [0.022561832756327838, 0.6364786978717316, 1.3221488561478794, 1.115488446858759, 0.07842454941055704], [0.05918917364946852, 0.6838177793727064, 0.6973916669356163, 0.7951438315534216, 0.16082998357322298], [0.009189884151310945, 1.7388863678473492, 1.74693394606617, 1.1071890221017557, 0.14227291111505735], [0.08230567769270469, 0.6988079873331314, 0.4972708456627592, 0.09377187051061892, 0.09784762679378112], [0.15666056877607404, 0.9766427357248851, 0.5183933377435462, 1.9358364475311134, 0.09217207097105684], [0.41895468002085245, 1.0309973452453456, 1.0010120294190985, 0.0978204415007545, 0.6974465814655835], [0.2809914795314654, 0.15627895967259142, 0.8452565513038777, 1.397283360602586, 0.1715263566370856], [0.03406763533143964, 0.7223983456921255, 0.3306116395108444, 0.320545337292346, 0.06994971896891372], [0.29571617212349677, 1.3232553791138535, 0.9883472593278418, 1.6141206278766562, 0.19049349025451556], [0.17527679368362348, 0.29339968176998615, 0.5865576889766517, 1.3053363678597567, 0.11860196022485892], [0.5055046852795545, 1.1900047808780705, 1.2863747836316421, 1.030165950476896, 0.6943843823300335], [0.07258445726956886, 0.6491673038736969, 1.714507190613357, 0.8285588724803785, 0.18333323337899654], [0.3511903729359105, 0.3329560660209298, 0.5459659600635887, 0.4118368890426527, 0.8614335700720539], [0.02943599536575947, 1.0663244850734803, 1.0379239973914915, 1.2465875657266667, 0.04817640191571293], [0.3065206171852759, 0.63470303347165, 1.0036819478276493, 0.5413588142410277, 0.8076588729780529], [0.35655407961500907, 1.0988442331462276, 0.19693703299011542, 1.2199190790556673, 0.9004489206416884], [0.03138246005951073, 1.2900876634803435, 1.0021289199470087, 1.2186018829203107, 0.3773137882159976], [0.16142227899952977, 0.5928033116842983, 0.39832567474701996, 0.05570800761316022, 0.3790449912425677], [0.25012934428747036, 1.173921471849691, 0.9663458026321226, 1.6350406299968583, 0.09115130744165878], [0.2617965523087458, 0.5607837390420027, 1.561973504371456, 0.10109756782924796, 0.6952394937255028], [0.27696211018222283, 0.039985673611554834, 0.2823736778361204, 1.4798674207519082, 0.2609541730316788], [0.4172433638745038, 1.1815350536853553, 0.5080749578318933, 0.7717722769000045, 0.7715646698039462], [0.4641385076584241, 0.3182804574342022, 1.5978207257413224, 0.752994798464632, 0.9216117791904455], [0.22113284699093994, 0.659433723213572, 0.2483877916120569, 1.3895200960224738, 0.1423571930907791], [0.6724277252052473, 0.9332194852927295, 1.4404175523823854, 0.1930261365244123, 1.4113020965256826], [0.16623412413096794, 0.5600102627738163, 1.4153017107556993, 0.9196267292506644, 0.7089773314514326], [0.27857485132393733, 1.2555439988999202, 0.2494768528457218, 0.3914000647296313, 0.5543158092602949], [0.3000598346283774, 1.2973261703320835, 1.4853201499609392, 1.0671385760455034, 1.047302102325408]]             0                [4.07096684821713, 5.405706452197568, 6.426690408633658, 5.920318809252212, 5.306628637855666]       [2.4763427111634453, 1.9970398393798028, 1.687731427206344, 1.233897305432991, 2.787545651736269, 2.3225668736116307, 2.4748353547782957, 1.9105910231534247, 2.4150619049947566, 2.2616348584175516, 2.4069542302595908, 1.745984173343468, 2.202404262378663, 2.214069656875039, 1.9671007634636757, 1.5257683189185565, 1.5226936452758395, 2.6988213152335363, 2.1066031348212846, 2.0448172068003, 2.319605170015566, 2.574226311694161, 2.4953426437478488, 1.8034572724824354, 2.9104250443250113, 2.0391765454069475, 3.504772175062107, 2.2519858296162494, 2.1874297121127175, 2.8578795595180173]      0\n",
      "[[0.06290282137115158, 0.4980054981920246, 0.2956961473025257, 0.06374060014599635, 0.4406259451683316], [0.17638763285539558, 0.11849440447156882, 0.08141094429636872, 0.6158787763333612, 0.022170087316273568], [0.2829787554525427, 1.1708482452981228, 0.8295718328912467, 0.385147265186913, 0.2766455036426241], [0.30720173090382413, 0.2298653589156938, 0.6992187893550559, 0.8248652185734022, 0.7410684055097018], [0.06499648106148559, 1.431262054619229, 1.374550739250691, 0.6166360272121347, 0.2940452052355111], [0.05097197696763478, 0.6863614819579492, 0.7410477903762412, 0.7711532199030151, 0.5796399284779252], [0.31652150445507354, 0.960065262846636, 0.9753651473134365, 1.006435762840593, 0.3117024219788149], [0.3153271441000792, 0.30016577314806314, 0.3563069293208731, 0.7093323906312248, 0.41874001187099075], [0.3527851467757117, 0.5567256245071861, 0.25872811944946084, 1.0483376650638945, 0.3098246791560494], [0.22651277875386427, 0.2671945599970439, 0.32018648835269237, 0.14900016222539914, 0.1965483027187518], [0.368174479209469, 1.6615754395076932, 1.1550880256242666, 0.07201978809808551, 0.11640884150039676], [0.1802123330756833, 0.16454431993850321, 0.1261379325644914, 0.6837488721301899, 0.40665035501581215], [0.1559349423750399, 0.8410820094585616, 0.4179336925106029, 0.4962343253541168, 0.08858903382084982], [0.04965815302340615, 0.5674878299353817, 1.2224388209971875, 1.4048539095412744, 0.37826973576161593], [0.5348789953126577, 0.8503683121747513, 0.26668052912714457, 0.04285997779418073, 1.0011159259937752], [0.32006527946284047, 0.6168499029104668, 0.9098632037978858, 2.2420021024254195, 0.1399857891190759], [0.6666221232444565, 0.65445127969205, 0.19662829102727286, 0.006604291479390678, 0.14228581656312622], [0.18729736934912466, 1.1848193161580238, 0.4697764552104445, 1.0903720600906228, 0.4305543887640814], [0.2263822171829506, 1.6223106449472857, 0.6608135307224317, 0.613331775053223, 0.6459879551597324], [0.6606161435024043, 0.30323935097832416, 0.3756684059444196, 0.4490647481841078, 0.7802391338432154], [0.10475315156089016, 1.490189289063387, 0.3522695865981884, 1.3752997165070007, 0.45557227014306223], [0.767529420794238, 0.514681825815589, 0.171927570258046, 1.026298835631354, 1.047427903321226], [0.01586024500322125, 0.231667030957856, 1.301823948174736, 1.6549082383101292, 0.797044056802977], [0.7523492178605928, 0.6064892926886667, 0.7878815537202483, 0.6873873949338416, 0.5649683732424275], [0.6424038537362543, 0.3606136646447716, 2.1169224840943897, 0.8772265791272287, 1.170434632963486], [0.42845003396204384, 0.7714381856678354, 0.3477155250485627, 0.7827757850808135, 0.22925711849602864], [0.19445907818749747, 0.5777331919298145, 1.7741449732721855, 0.04653483757499183, 0.5790121105073499], [0.03656869464675597, 0.18183764713047176, 0.2875848069892379, 0.09211017706595495, 0.8244416799126919], [0.028350410624789414, 0.9691465625760824, 0.022560742356174803, 0.9998183320712773, 0.7273123137339453], [0.7615445188583024, 0.4330391396512474, 0.2632176416276707, 0.6152594789420424, 1.2205538083573937]]                    [[0.19547644045066143, 0.46611974701454184, 0.24835379361926574, 0.005210474090488051, 0.3414228220090527], [0.44442222577749635, 1.3015429354451455, 1.132486485279324, 1.5641664994383233, 0.36363803726768595], [0.056718062382066226, 1.2298309839624846, 0.5935567759475117, 0.63466133034975, 0.2390422942264454], [0.03740943579177958, 0.8687760104762792, 0.20701078300257103, 1.3162028560858672, 0.225129232815664], [0.11826146755798561, 1.5247005384159675, 0.9829839062241464, 0.9620612156132771, 0.0678060536347378], [0.23705035839132726, 0.9447575046227616, 1.2027994762539813, 0.34451843164185686, 0.37077183328192387], [0.26890631713499213, 1.2698823197486953, 0.22996500064058156, 1.7167338644337127, 0.13323712356911221], [0.022023474570320473, 1.0734139270783283, 1.2680857183552343, 0.12265915508186634, 0.25755544177650536], [0.06370600834598705, 0.18739301372124315, 0.5565517639480424, 1.7856548007142488, 0.5639148883082606], [0.21573861481619017, 1.1087080068758242, 0.5142692619711596, 0.6488089094708529, 0.18291264154898945], [0.11343414920462247, 1.2606114378963489, 1.9500736546385184, 0.8413399040632957, 0.11385886932892986], [0.34620788369790745, 0.17968672942566427, 0.04264827678004916, 0.7261545693988354, 0.5282490380773317], [0.14511595724606885, 0.7043036957329549, 0.7310054068338543, 0.7801204452063613, 0.07146517053105245], [0.22454191342520824, 0.6349934628075964, 1.6861327003112945, 0.9667373130483854, 0.4517806786480576], [0.4545032459912172, 0.9331782069940695, 0.40689064002839526, 0.07428307288767015, 1.005563320511242], [0.1252402358357767, 0.8759170510349892, 1.5835390036042591, 1.5766069405642953, 0.12261865784739157], [0.15669331909271111, 0.3471781565323389, 0.7783297530357005, 0.5197441583113076, 0.4933498962148803], [0.11320623381569406, 1.1160029584878284, 0.6265900183708228, 0.9509458989424456, 0.31096790493674875], [0.11757076654579746, 1.3498455529265785, 1.339364670964324, 1.2579716385136364, 0.5914658687516677], [0.24811344270702007, 0.0985671900066833, 0.7624371201298719, 0.7809401455181934, 0.7494187481926085], [0.21493463267824953, 1.312035306297366, 0.22440656173414403, 1.9061062555105355, 0.05059531108856796], [0.4994051747310671, 1.0965662031825965, 0.9424518188368516, 0.3070490926412125, 1.0788610242238625], [0.3699302483207172, 0.21900565929058707, 0.9862666158589088, 1.918900399998173, 0.4401187114147577], [0.35941904724592594, 0.7847686238081476, 1.1937456664839088, 0.3394470250772047, 0.8074201513618242], [0.5751195287520924, 0.4702004569200166, 1.7854740663390956, 1.2007982375036705, 1.0595631267758416], [0.2563826644616478, 0.36268346662612844, 0.5395274435667933, 0.9178613188074413, 0.2686956025419992], [0.27666995140119993, 0.7889327792433225, 1.4642896779291703, 0.3231017053489374, 0.6059544842580581], [0.043126648526415456, 0.8527291376132246, 1.235240690441948, 0.9967408042369672, 0.30284054846838504], [0.3379839712342319, 1.3467495667533427, 0.35307877846659236, 0.653059234994448, 0.713244552425492], [0.2006670514557749, 1.4680439831914667, 1.2255929468560998, 1.4825080258171073, 0.9183088466084701]]  0                [4.797414995724164, 6.765524480734105, 6.348788133422567, 6.230285207270649, 5.436413543094264]      [2.276423062387344, 2.85734545481326, 1.965923875566993, 2.2099501174452234, 2.112748681212313, 1.465707827060622, 3.1042354502572724, 2.477525728350522, 3.145569440556514, 1.7837783334509163, 2.5096277292554334, 2.143857429973517, 1.3991503731115058, 1.9292134112643669, 2.3979596734592192, 2.0099678487108634, 1.5679242174382875, 1.3730957623349385, 2.2395175591324916, 2.174740828524526, 3.3506581683764125, 2.2252488574760947, 2.9359065994992366, 1.653939216788122, 3.568277271724903, 1.4737835164568254, 1.8154801468911799, 1.4775264728164879, 2.157693715305271, 3.2525438252742567]       0\n",
      "[[0.0798940917295807, 0.3346276620138972, 0.2678634873581634, 0.22417462534852045, 0.24126487885458117], [0.11916143038694343, 0.00032125697141394127, 0.20152993165547142, 0.07792816037874972, 0.3247621200387074], [0.031245825677229, 1.1009933941942074, 1.3554587689245903, 0.9741743592971371, 0.535827901124724], [0.24052626311018555, 0.08846739053435834, 0.02708962213772126, 0.25883081576539063, 0.3024683080854754], [0.2128046439869986, 1.0584099109924674, 1.6902254146256919, 0.7761100824048088, 0.005403793945739421], [0.5732204997422634, 0.5963913736626938, 0.007528578975794342, 1.4337591874288982, 0.14270276662853915], [0.1912976889407001, 0.6637452013086775, 1.0146697529218802, 1.0135384576529176, 0.685402751602471], [0.09913390776717002, 0.5210488491811904, 0.5707219006150663, 0.669109144874299, 0.11457770876225637], [0.3635799093508776, 1.1841345135266335, 0.17101092031676468, 0.5301232225585155, 0.02252836332212027], [0.4879193764845976, 0.5493169237857235, 0.49861404098309936, 0.38498390575014757, 0.35549020518227725], [0.1192115936595679, 1.410591912035268, 0.8479843255165382, 0.5299502542927893, 0.597305580518028], [0.004885949807721057, 0.07415026828003846, 0.6332051071106083, 0.6635928647128182, 0.00789428126277325], [0.33994207695415124, 1.9005880232806553, 1.0603886044094981, 0.45426993884807276, 0.410434888039806], [0.15720573181025554, 0.6300568290478427, 0.5535403480828939, 1.5473710994786603, 0.265675575187372], [0.44019206387090826, 0.22418560131362014, 0.16566961115066695, 0.07056384864996487, 0.7275314777240344], [0.46604271777026396, 0.8872044895676127, 0.5206883980767332, 1.5830730088735647, 0.03850546893287199], [0.7676461919822997, 0.5960183007394728, 0.6823746442736409, 0.24324852430442157, 0.19058702270407174], [0.7923348401824272, 0.2933448912819626, 0.19243682081088143, 1.479535095162602, 0.2446675912821349], [0.4403670714142036, 1.3781716222584746, 0.9202568900914331, 0.7686006557039236, 0.07519513409035727], [0.5869460862719287, 0.20250519884001628, 0.5546288257802343, 0.47724382490005984, 1.2630040384987662], [0.11290724552020981, 0.9706167816535535, 0.2515041669999605, 1.0597735798980101, 0.05436571629420328], [0.07920534658291234, 0.522730581152498, 0.8131101589167719, 0.4279825158878432, 0.9353481654635021], [0.3384925327225745, 0.10828121052796708, 0.6592399953603809, 1.4163242182117761, 0.5724090702544454], [0.040763451383934, 0.6959264874220286, 0.11402146124356694, 1.3092699754602592, 1.1169905756242553], [0.5833564937066583, 1.0767377738757082, 2.130634237893843, 1.2431051832163065, 0.9177887669312268], [0.005026425149501468, 1.2426983076819929, 0.09014072809302803, 0.9734695127992464, 0.37366767665483874], [0.6511703388946419, 1.2519265215523572, 1.0107384869018916, 0.4005790516684665, 1.1389625255036395], [0.3524469205344797, 0.5205765706328075, 0.61152075123666, 0.6590638286654453, 0.6470688781666565], [0.7658559238477871, 0.8355368805784272, 0.20084658994575694, 0.9698299955286943, 0.8385695037504904], [0.5686610763624239, 0.06276937440317734, 0.30836642153570337, 0.23832263347188584, 1.196583353399086]]      [[0.15619407373428656, 0.3067494415379041, 0.2305647483048995, 0.17492400408462774, 0.23365230893177044], [0.3361874211928566, 1.160573098414901, 1.2633095644178494, 1.0587357685504581, 0.24931190119994096], [0.17993560064412817, 1.2357339489193737, 1.1007829287867656, 1.2312080373044325, 0.5568342935394259], [0.1603689869500573, 0.6520499329976418, 0.4828563250762118, 0.7045690765295682, 0.08473515105032037], [0.0008005229337519904, 1.3088925541004441, 1.2427463663071663, 1.1738442648957013, 0.173001085527279], [0.018543048106156812, 0.9808750448138313, 0.5399735897562692, 0.8780395758290345, 0.12272432667534783], [0.1859413622063968, 1.1909762899986294, 0.19238039443628355, 1.7951531788062414, 0.7880828140925611], [0.18386280637290237, 1.385654227764584, 1.5163441056137172, 0.19612043938593604, 0.09449718192311654], [0.08866836234908804, 0.5803303654659834, 1.064215340295187, 1.3337015192787907, 0.20207871876366557], [0.18673463342464935, 1.4039604097800225, 0.35432128690909215, 0.4466219090315964, 0.17321236330385348], [0.37245053828996866, 0.8305581699431386, 1.6731810064933241, 1.2874235056913457, 0.3160104895050167], [0.17073610002765216, 0.16615774204687858, 0.5706698321531986, 0.7055816004542019, 0.2426608083512487], [0.34093103131905245, 1.6698700744722186, 1.4072045179306858, 0.7700831863698703, 0.4315152576280623], [0.003519120108870233, 0.8866223937323705, 1.0661028219319806, 1.0855885470458182, 0.06993754784045769], [0.33737390474707446, 0.34180923822836734, 0.013805367261253247, 0.19772442548391292, 0.7267220330191556], [0.040098270412306736, 1.3463985528156424, 1.2665251429370854, 0.8490790293255519, 0.06310603264447157], [0.1584649960827848, 0.14370269346815678, 1.312358995785409, 0.3242576549836084, 0.5225838510874429], [0.11818556229170385, 0.3523966721013306, 0.039343070860568374, 1.2347671358367258, 0.4806583661698746], [0.10768356720930505, 0.9198516918861692, 1.624635232050201, 1.389161350773048, 0.22268755187316824], [0.40235651291176244, 0.6194477000382103, 0.9576644120520275, 0.8373458701098642, 1.1127952180066112], [0.11824684226078475, 0.5813780762915293, 0.9200680923094273, 1.6965588495081978, 0.2055408837567978], [0.20381333943209473, 1.2183276549024342, 1.6436620400481754, 0.3707957597016502, 0.7199894104860491], [0.39930792408701743, 0.07260041229989048, 0.2684402160798151, 1.7690670530357024, 0.4388052552685574], [0.4695772824997293, 1.021882205806982, 0.3883302964970424, 0.8185512034685254, 0.8451861361186284], [0.5326849321074381, 1.293876596799653, 1.7606976835259087, 1.6029196583332466, 0.8491331642793906], [0.3805849413608182, 0.9133457616210982, 0.26753441613297857, 1.1116294316803692, 0.5282795067402553], [0.6855049159056993, 1.522362198242405, 0.6769979006261116, 0.7028348888484844, 1.2172534057015234], [0.08024223759639226, 0.47457930254970937, 1.5247052790853188, 1.5070022611885645, 0.3538962546532981], [0.5323560643124723, 1.232087404165052, 0.20730601428746578, 0.5618403524022341, 1.1009889896617369], [0.22924495412900092, 1.097084923635811, 1.280926211803542, 0.6509262539534617, 0.7855448791484997]]     0                [5.025810323875932, 5.899262244749986, 4.678558125708746, 5.504169464986474, 5.145063449933794]      [2.2623885106535537, 2.0382633514571977, 1.5383285300694431, 1.6181622757493592, 1.9447547383624701, 1.739427620581029, 3.686475472760985, 2.8010475121387666, 1.2776853894978437, 2.569036204587513, 2.6340428055772636, 1.6630856206231344, 2.2617311792592774, 1.4670213461289137, 2.349608849771853, 1.9171722823536834, 2.6161292029753653, 2.380751996849664, 1.804531343213955, 2.42040711034105, 1.6670976702897626, 2.364227778206759, 3.107899588199854, 2.0210413652757313, 3.1806918771240285, 1.9157858248936006, 3.397078409970654, 2.2911558802248337, 2.9205350520680793, 1.8545897360177395]     0\n",
      "[[0.22460295011193, 0.2136917468590264, 0.4082209164403445, 0.4532689275930162, 0.09255318378666696], [0.4260313677583272, 0.35726595759797747, 0.5126124747452279, 0.006650166051629852, 0.3781686261830144], [0.1059464963240605, 1.1075668453781462, 1.5038574500946467, 0.9250665358022203, 0.42163905343412733], [0.0311293155484042, 0.3487638418986544, 0.2274432436941829, 0.4985224749459569, 0.6337333588378946], [0.33244289828262685, 0.915091678238058, 1.7717912088306358, 0.9386368157067274, 0.38567610699081845], [0.5626417874172539, 0.38860829665029306, 0.09384376089707203, 0.8281994372943239, 0.018618634027366243], [0.5050159482952814, 0.7593929338900759, 1.1147726084628318, 1.2688448664427656, 0.3648375520536957], [0.11343861031647784, 0.14641943590768342, 0.05995456102920188, 0.8902888601878979, 0.30120701430543095], [0.4742976262329741, 0.5253257091852999, 0.5190609531407417, 1.1283986918966402, 0.38696121275601136], [0.43922655970952407, 0.08059042543269179, 0.1592986862050824, 0.11537782237586831, 0.3148170511862938], [0.011036651030254196, 1.3509070357227517, 0.6776777500610012, 0.45887222368131775, 0.18725525795777975], [0.27595411162190575, 0.44412368879980063, 0.49524883909578193, 1.1882998634255952, 0.4744058845645966], [0.1039740614956789, 1.5024902357143213, 1.1770814051469458, 0.47726558617911896, 0.042117346731526284], [0.29253832202462826, 0.8487285869396144, 1.3812918558919085, 1.8529330958438925, 0.1567092382321491], [0.365833041907467, 0.8634035760509802, 0.23603991398695243, 0.3638525789619438, 0.6551942110187929], [0.48875846739059137, 0.6672815510706918, 1.1092710051399952, 2.0262528673923503, 0.10774916343640772], [0.5684922330255967, 0.5522965449714332, 0.2012383429496073, 0.7664914344482894, 0.7111516590675053], [0.8614060460449092, 0.49385419027716304, 0.42408472657833585, 0.9784263341995946, 0.3322671654611669], [0.39561528697757065, 1.604825183892916, 0.5726119932249775, 0.49012072850377486, 0.2074731596234095], [0.6477248762697592, 0.3016987173692711, 0.5895658364125067, 0.47931057071744215, 0.5608297770101207], [0.03042661742013486, 1.3571671343806702, 0.17417581713235875, 0.890509586560657, 0.3773339828872443], [0.6387144456087992, 0.06641508930052009, 0.6377237327325656, 1.1080310390139494, 0.6878237433244478], [0.2985096429637706, 0.5410069379237926, 1.0744381236048686, 0.9953149365026959, 0.41841026251053703], [0.7772895355163036, 0.7905130521398431, 0.8401991228224551, 1.260368826795336, 0.4543754546322644], [0.45665630565490356, 1.0511436753549672, 1.4533537285525322, 1.3736837846816334, 0.7335644673830769], [0.14736289931401603, 1.2861304564118083, 0.2876709089658139, 0.9363049976879109, 0.04690151623218708], [0.2520304907537854, 0.7685948078679622, 0.8750376389205423, 0.12389740999428547, 1.3176770077560234], [0.031209390632205375, 0.5027278827187767, 0.47558402221684015, 0.5085965349916592, 0.1236463004533459], [0.1527733862073654, 0.508946991706325, 0.21763418573941026, 0.8011154969692933, 1.128942082124179], [0.48408159316344257, 0.15916367442914972, 0.4797673805355731, 0.5599892300734215, 0.6934286061292192]]     [[0.024702326303040756, 0.24430667835117273, 0.36411369815112665, 0.3907069658515276, 0.16233735989082287], [0.20739156963061123, 0.8092173514398959, 1.5627468245695137, 0.9596362577279816, 0.0025066328442524544], [0.135747457442563, 1.2052375097494237, 1.272654195110145, 1.1153245055112422, 0.42381522553282447], [0.023492506050788897, 0.2479526862200595, 0.7046030492583112, 1.0046280690251326, 0.25819225927878153], [0.06546297395767642, 1.1021634715418906, 1.3468631046718906, 1.2512109474189295, 0.300649356194871], [0.10652870547177873, 0.718462824446272, 0.5975883344002604, 0.38602294276107624, 0.19700299725886294], [0.3437111688265746, 1.1834310437834366, 0.3614132396926606, 1.8586476253907156, 0.2696385310160545], [0.3184517173435195, 0.9682001323952598, 0.8574050922326923, 0.10409387212702799, 0.5176834529242827], [0.12285705261701607, 0.035751335804987384, 0.29458583963074925, 1.7142744202455893, 0.6440541566810307], [0.29816768974290064, 0.908655928164634, 0.9524065143060059, 0.5973466009931621, 0.3185514236139124], [0.023707127593054267, 0.8564093252080491, 1.4581401718128093, 1.0778327081306334, 0.3070466743406882], [0.4911725981751487, 0.1501217841984307, 0.3953945353770036, 1.3324926242925796, 0.7392646653449112], [0.1358996974396527, 1.3185521597993974, 1.4885069353473592, 0.6992847104008069, 0.01470934160771803], [0.11017538343296329, 1.0074570912863705, 1.821239168894447, 1.585000448050788, 0.12288778604388362], [0.3098428876677768, 0.9648025556340843, 0.3778689083236756, 0.26552492144039197, 0.6431605591537606], [0.03772809702234481, 1.0289261809398034, 1.7847943215623425, 1.4820904686416079, 0.1518994235994633], [0.29283780680294624, 0.16452794651137673, 0.7970269112728618, 1.2287492762722654, 0.9267664916691647], [0.2127993701063422, 0.4963789522645847, 0.613560845691217, 0.8462349812697312, 0.515434784681694], [0.08837351679474614, 1.2418202306423987, 1.2167022072223572, 0.9390937100454698, 0.4561234267547746], [0.14635496623846378, 0.10322424916229272, 0.9714936883997234, 0.7954730591167649, 0.5735383160154107], [0.1845131375111031, 1.0724443657582794, 0.7582050920165415, 1.3087143996659463, 0.04938505393506598], [0.32594006222765637, 0.568040836364954, 1.4065778600804693, 0.4573425398345168, 0.7292273434591781], [0.22842624308275994, 0.43624937950984993, 0.7341775829734435, 1.2070717443858943, 0.2942007588950847], [0.3636214539931772, 1.0333875713760983, 1.2458878660019481, 0.9920600719127943, 0.6920841744526284], [0.44659038881728863, 1.2145733370832665, 1.1242476532147943, 1.625484073490043, 0.6067600724375163], [0.2696969046362132, 0.908840847209312, 0.5099484085222841, 1.18481049385695, 0.265321151163475], [0.631375886537096, 1.0028228646668127, 0.5811797582007088, 0.3329303636071478, 1.2020186417841972], [0.3447347131578944, 0.5082967242108906, 1.402573033274107, 1.3913232231889725, 0.2085073637192446], [0.5429808797388467, 0.8881799488318759, 0.5888667391471549, 0.4671808448467322, 1.0751286550772579], [0.06703112969338076, 1.1914927525696577, 1.4426397369455044, 1.4317395917639193, 0.38694506340881063]]                   0                [4.815457775697667, 5.207017111332164, 5.615621104870112, 5.391808117902241, 4.831599981708739]      [2.275313653764342, 2.485171727520916, 1.3494768879063217, 1.8544367616813409, 1.5741746473707914, 1.589635746130931, 3.072393044547609, 1.6930293844543034, 3.276189082295012, 1.3650315120980216, 1.8769014309939576, 2.7272939859987284, 2.28894310913597, 2.3453746522422017, 1.7454569310769883, 2.2738362427685854, 2.7195169910876578, 0.9599771488548005, 1.727642907674408, 2.2008257818035224, 1.8163312603795585, 1.9256916248843163, 1.1990684538026823, 1.2391486554374231, 2.4190334517443217, 1.5229751636518414, 2.8226638610798593, 2.7156512677197733, 2.2802047781698165, 2.0220758539383317]  0\n",
      "[[0.17532604344903835, 0.38786752518852485, 0.3149394224662538, 0.026627971596989302, 0.19591786831588762], [0.035364831854575424, 0.35916422249102986, 0.08506878617686708, 0.017606707909608194, 0.750179221380275], [0.5281137536943432, 1.4030499680995443, 1.370431696596433, 0.23901668558304046, 0.5262316331678243], [0.5492333087339333, 0.08830855709151891, 0.2082151410158713, 0.8463019669786394, 0.19189077866932383], [0.32387466648546237, 1.365467436803679, 1.8865780196365185, 0.863208747980303, 0.37585271941149007], [0.2833016114295793, 0.3229325316750929, 0.3271202103053136, 1.3357574910316308, 0.48597667270474104], [0.46533864805764824, 0.3997927083125075, 0.901182266382942, 0.6461588854433995, 0.4956056751224883], [0.39315605048865787, 0.2749430752644566, 0.678174879966108, 0.9818955074801126, 0.11488646710252004], [0.23201422283773265, 0.9245675468137726, 0.2980752040616854, 0.6698625002869941, 0.11958570942499713], [0.21706114091463422, 0.051603469040781315, 0.03949138717459283, 0.17889666576478586, 0.013694559330865538], [0.04592883090856614, 1.471282033497599, 0.4982591213478278, 0.9095864445091298, 0.3586885135904583], [0.3269119633050932, 0.041996675553737345, 1.0179185743348893, 0.7200408152969097, 0.43418096531397143], [0.5012947165049102, 1.7637886662973092, 0.8607970195904383, 0.4503721393162093, 0.2406441973007049], [0.275746990644566, 0.8210640284029531, 0.8881537419613229, 1.2417838988732686, 0.451572461620799], [0.5928396905366613, 0.06223673942537858, 0.3945790782761639, 0.23461712589089811, 0.2662411170477009], [0.47295132655824523, 0.9216281557749019, 0.6455957989747543, 1.9213980542023408, 0.11667833941260675], [0.7636089972195848, 1.146847595843898, 1.0306215080698848, 0.6965327632060765, 0.14008100033909304], [0.106314172151322, 1.285901287736443, 0.2992857351346626, 1.4150617765966178, 0.7893166684000665], [0.1893251164332621, 1.6355859357345348, 0.6725583158366977, 0.3861225901341032, 0.5298118327179752], [0.130112498756418, 0.0020478372416982034, 0.12873472560766683, 0.3132763528130201, 1.1345851468749326], [0.4872999727263112, 0.7321702575083213, 0.28151934798982403, 1.7318195833400387, 0.3326589677617816], [0.6581436500323434, 0.3010392135030857, 1.0896659654852603, 1.061462285472158, 0.6156141968786463], [0.4091252070490077, 0.18556682619785925, 1.0825156540252303, 0.9141352163448115, 0.7071546054296542], [0.4624149382821566, 1.0286900705798927, 0.058963373031979405, 0.9005287008187816, 0.15189432836846406], [1.0711373959716164, 0.34514748647773463, 1.5483120231001815, 0.6992741029457223, 1.1934303987841952], [0.16563546403841212, 0.7078092329315777, 0.12715934562061765, 0.2915161556374284, 0.2501941389972409], [1.0698509647068675, 0.6076373054710859, 1.6326571875086457, 0.37236429197832127, 0.5004141220595317], [0.21324977718108457, 0.9381253599296276, 0.6853602205486983, 0.8785656716540928, 0.3845444943966638], [0.03134100412538616, 0.7990432013017957, 0.4806676531251987, 0.3789337494110906, 0.6205865165366569], [0.5247669426110264, 0.26893938012931057, 0.2212316040691108, 0.6796270027800901, 1.473018380414396]]         [[0.1399876594051076, 0.36260783175898276, 0.2838110155045018, 0.06368226769105607, 0.24447745159387738], [0.11001492780549715, 0.8430610169250244, 0.9780995659839793, 1.0076449228936353, 0.14356998797506515], [0.12168188018834103, 1.447685758479953, 1.0815594670892357, 0.458230068288146, 0.28621643605228064], [0.2344172238280755, 0.7224614025377092, 0.19401205338758049, 1.280214808618561, 0.13653671692161384], [0.039798813173382186, 1.4291980262036357, 1.3944110726077532, 1.14199107075834, 0.2355155794859778], [0.09686747548724511, 0.5507241212643579, 0.8315525193674329, 1.0046380368626542, 0.29277923075091566], [0.21582076376810155, 0.6447137147827771, 0.07473823623818818, 1.1497502360206864, 0.6970143407700181], [0.2548803789861981, 1.0336263597134738, 1.6544708835964563, 0.17588045236556446, 0.31625715868651727], [0.1336211793009663, 0.6203743936679564, 0.6191651446000315, 1.2087809605419442, 0.035131213791745663], [0.2933090969626272, 0.889402588326965, 0.7930929305112757, 0.604212778908201, 0.32579535635021095], [0.31447513225739, 1.1342385192593412, 1.3516275080987028, 1.4658579462507393, 0.2113073304254065], [0.4126081070163914, 0.42597001008194385, 0.9600009015760383, 0.8996357455453411, 0.7126996821910826], [0.2942047080356778, 1.6476854030910488, 1.2267389804894007, 0.680324592051273, 0.37684455869163574], [0.2836504886074884, 0.8296731580518003, 1.4257121710175085, 0.9911263540326692, 0.5440466777239339], [0.1959950037715133, 0.004052969422980423, 0.5330279591455517, 0.17996166615922, 0.4094986468764825], [0.02701439583354004, 1.1285129756083352, 1.4117352036140347, 1.4101849547054965, 0.044336196994174015], [0.06267840856984291, 0.8830885534364878, 1.6674298743533769, 1.0846175448518414, 0.5019840271497907], [0.1990550399032296, 1.182874621769099, 0.10069752086296277, 1.3850200003465347, 0.65200555718517], [0.062166342943028585, 1.4200344007910353, 1.4378164740953765, 0.8563700363077094, 0.4025850516458057], [0.29163956600329993, 0.4099974001237859, 0.5517309912501648, 0.6993630206622061, 0.8090884336856847], [0.19267921079016737, 0.6164475425168114, 0.9292396131425995, 2.0607200080559758, 0.13549259611660036], [0.2532173011455898, 0.8519168415030894, 1.8993925266759475, 0.44076352679085096, 0.6551574690415961], [0.39969892562510756, 0.16335753940973485, 0.6747685525151947, 1.0884927154985258, 0.6267514181306104], [0.1593812822620222, 1.1750709588616608, 0.4086744140155313, 0.6445237120316041, 0.27534989631188933], [0.7033586616475, 0.4327484717190157, 1.1521078706857024, 0.9692533264991801, 1.2962782915644981], [0.25465060284530194, 0.27011013958595737, 0.29510002415934006, 0.524204589285101, 0.3727590653974998], [0.47560376009939365, 0.818556263505843, 1.259435645902084, 0.6758065213248085, 0.9014604398417665], [0.23061712258935207, 0.09455427800973301, 1.5955157049175754, 1.7596214934030932, 0.10029184979765127], [0.3275066272652589, 1.1751548428122358, 0.10127855302559556, 0.03609333559426124, 0.6171977175256523], [0.26046546776696644, 0.774242358599326, 1.197489683682925, 1.583538230794752, 1.0248047456045104]]                    0                [4.678072448533853, 6.30261420638153, 5.147342832542393, 6.77549846179052, 5.709026785750952]        [2.340541335732881, 0.9455260543020081, 1.948213980874046, 2.1258386339067497, 2.0000771863146856, 1.013657549323158, 2.3756085210137607, 2.4869607996126852, 1.510192013323325, 1.2803612430567841, 2.257803930329002, 1.6549030993423952, 2.121398165364291, 1.2455718501375288, 2.3643934865553384, 1.8613865832614302, 2.363160006373977, 2.9065910161077424, 2.1227827620423163, 1.7656639382971986, 2.4554639381518437, 2.5142208646377053, 2.0333208065595962, 1.7836590690597804, 3.5990936446105413, 1.735047908544193, 1.8857164828681185, 3.413207999846903, 2.6446145882845635, 3.2163745441219893]   0\n",
      "[[0.008997266421676363, 0.17191993269127218, 0.32354487559275413, 0.4410776556218223, 0.3835749997887506], [0.5301431516466155, 0.39424443736021986, 0.9255658482363125, 0.9822050380662809, 0.07083918961788792], [0.2507050419213873, 0.6955224533848507, 2.5271799415475336, 1.316859281134648, 0.3689028983210947], [0.2662460673701382, 0.2264382098919644, 0.7484223542940507, 1.9470774473254175, 0.4358824392669054], [0.5154013598335463, 0.9902096891207505, 4.833595959397763, 1.6564216326968875, 0.06713595177719878], [0.40018954053603695, 0.45014958635840707, 1.3921623014183262, 2.824154215510394, 0.12926789854220794], [0.6035375896516544, 0.10882983940122148, 4.998884770427768, 2.4341542409378687, 0.020657169001852438], [0.5524192999340634, 0.17309346206766585, 1.6008445894813614, 2.0959812849868147, 0.30575151520157107], [0.7465227698129355, 1.6472192217260673, 4.435955205752009, 3.3095799178656673, 0.5172455591329689], [0.48459033949979935, 0.11809972317381212, 0.08240395926250058, 0.07819339958598687, 0.007736261406553098], [0.553660258258263, 1.7126677114480935, 2.8001031377779477, 3.3220500184225865, 0.13847193858162976], [0.9669029442969337, 0.23926722714561033, 1.6146784995507324, 3.0220086891008715, 0.09785241106172127], [0.1815543154977095, 1.5923338903749877, 0.4924542163173846, 1.146165925306955, 0.27295602158994164], [0.9303652367122814, 0.05530186110430435, 2.9025824298537466, 4.6966689508992365, 0.28812927331412796], [0.4926296773487684, 0.5749786086212325, 0.8842345554030321, 0.21360905392401552, 0.8141883295296026], [0.7096880706851556, 0.17672486552605493, 3.4041639388551044, 4.802335798018895, 0.346523197616212], [0.8303941209564922, 1.0673094823550502, 2.266171725687591, 2.768139136415609, 0.7902646434854766], [0.4382836938695007, 0.40835501177431033, 1.7192057525274262, 2.657483241614239, 0.6530148852726918], [0.7096266273143377, 2.6236174713061873, 3.342941509391687, 3.3372140297707613, 0.4739594654019419], [0.13880091364573305, 0.2741745775967188, 0.5278861232890248, 0.22170922278269337, 0.6831567738027354], [1.1293535862550113, 1.4688032817605767, 3.614200218493048, 2.059544648666603, 0.4342661536040119], [6.002025312543274, 0.10132902310854186, 12.870802348589443, 4.864709083089961, 22.970365362292956], [30.228536535021288, 0.5350850672141079, 1.1975808595293307, 26.636084359149724, 1.7605476835018996], [4.616976502033501, 27.55262317979518, 10.791428469502346, 10.668042397163447, 9.831160376170427], [39.38982819114147, 8.600898516379113, 28.18364019135123, 11.117604813863267, 3.5721164034837694], [23.716505031216172, 5.168404612483674, 25.30299485217888, 14.32982890801343, 17.25707579289764], [4.080757958264736, 29.574724013009682, 4.909605099521663, 11.357123734806885, 23.403344307296596], [17.297603077023965, 6.6848031936740515, 9.271300643618826, 11.576528709215692, 3.613496768885433], [7.666886168193194, 2.965960572288557, 11.284438219153689, 8.703502775554238, 9.984441991558827], [33.08518077461325, 22.956444883627665, 31.996586108480706, 18.40252130129429, 5.756952313182498]]                                                     [[0.17730375341870874, 0.20251778823480815, 0.36846401378702104, 0.3783950810656052, 0.32040082186484037], [0.3108380647874398, 1.4489123044991237, 1.3835131489462562, 1.3342038526838969, 0.11352663249501549], [0.15191235217145482, 1.0546423233474491, 0.8563910966222407, 0.32278963857465554, 0.3243224589606366], [0.058189447479650935, 0.588767746446806, 0.05802262613629433, 1.155472975987291, 0.15310037831477064], [0.0828778158051755, 1.6851014334169154, 1.5902516917818454, 1.4766360963407954, 0.0537027126951779], [0.012947330248178512, 1.121216426861614, 1.016893315365621, 0.4840999742930635, 0.08338414555510781], [0.22855009283653915, 1.2454008131221341, 0.3178400266174467, 2.1067377697345866, 0.020177895472467733], [0.33041446613201403, 1.2859647525385913, 0.9391790404841599, 0.30864813898593, 0.4293928614001261], [0.03650087001255797, 0.36681286501874233, 0.6923600679445572, 1.6509601854228104, 0.3427076903907521], [0.40182807048158276, 0.9867941977146689, 0.8763493588195009, 1.0023541142247072, 0.44219696571169115], [0.24656719872318655, 0.5770069224984594, 1.506094018166633, 0.8502154738890589, 0.16705610463098142], [0.3543914307599765, 0.17527864737570442, 0.28066944604331656, 1.1759031301352383, 0.4740346283896312], [0.3625100963655309, 1.095064877645371, 1.527000187834088, 0.8087663790376795, 0.4272154759883942], [0.06069521845104475, 0.7531299191525743, 1.1122577803252947, 0.8275799933381038, 0.1428697328473354], [0.3165445549676086, 0.7924041733357365, 0.10560482724033762, 0.5274429315783511, 0.7663656931598769], [0.14222114915629214, 1.1832905807031626, 0.8532052671719104, 0.6756187172740455, 0.28141489384886686], [0.27979465940340353, 0.19064402271043476, 0.9975108329174549, 0.39868988535291233, 0.7429899328097984], [0.22918773846051932, 0.7657873053430623, 0.4812427501919057, 0.5443032839637166, 0.48549895693145906], [0.05133523541960194, 1.5763198324822054, 1.03306452676393, 0.8967234520789994, 0.3382669314559906], [0.11397049024815714, 0.17511867433488593, 1.1185885755483116, 0.3319836477849799, 0.4287698057483613], [0.07096579198501107, 0.5172131752091726, 0.6400548442143728, 2.055164485845724, 0.6308212338146144], [11.88134702620492, 0.9632191621289492, 15.242463400108623, 6.8595117930425, 20.41337554801046], [4.34470885590596, 0.47047881554966386, 0.6511847774522548, 27.03625107877714, 14.505614933810861], [2.520577610727381, 28.185835110392944, 13.424488975996615, 13.118817002299691, 10.5686731635773], [7.415656331874352, 7.3560662370731595, 32.24765239522805, 5.398263557958315, 12.680957859499063], [0.7110745450960785, 5.595852183794286, 27.920164691564587, 18.16432780156037, 5.818177349327282], [9.354500339109649, 29.43850064061574, 5.540625269232127, 11.231199675282708, 16.875800179545056], [2.691445946368791, 6.093973940154101, 8.867417440029211, 12.789691792957473, 3.2969327714939505], [2.0026076687129812, 2.3379236678987905, 10.233833549886928, 10.25262520583494, 4.957388497540087], [7.634465445371383, 21.35861161610668, 34.29495066563298, 21.98668072914242, 7.619422075160456]]                                              1                [237.5421821785525, 159.61094598909222, 193.75199420628272, 141.43792123815405, 139.03333098836114]  [1.9023715446095135, 2.7433491971519794, 1.5062920724849695, 2.0977378111206115, 2.6171133988921067, 1.9879617135270036, 3.5150573496102027, 1.8711795377253642, 2.289848986836407, 1.6733306161940436, 2.2479661737406897, 2.110098937506398, 1.922180230475436, 1.265904383054202, 2.062671044771529, 1.2600243096882338, 2.1707200921112824, 1.0895694767529915, 2.2906958212740665, 2.3724842781406124, 3.476585315068946, 87.93282296312971, 80.58809461755129, 76.95450624438965, 82.39088923127072, 68.78124568450053, 92.77443732151438, 35.14621906075952, 32.36660128101787, 99.53221453908209]         1\n",
      "[[0.20891761199925626, 0.3548267350271715, 0.02238133071784914, 0.03043722652152188, 0.385542006693887], [0.250948416067711, 0.013922534229348804, 0.7386984900887619, 0.6203818327395527, 0.9051047485118011], [1.3898629704291938, 1.2795394547215098, 1.8292167892668945, 1.5106435178652013, 0.8478996858338352], [0.6109516421509247, 1.0069411853211085, 1.023694892334448, 0.7725358501803143, 1.5052218436612899], [2.1586477501845764, 1.6022298241142663, 3.5672705090540786, 2.857853756356456, 1.7776052732465444], [1.4006153256434781, 1.2004558570328503, 1.102874505298054, 0.08028416873155708, 2.0781671506947332], [2.532047103370076, 2.2553817752969056, 3.9086224710146515, 3.8361334021023383, 2.430596220923784], [1.3014706800841267, 0.6311941882538192, 0.9045444838760395, 0.2114510408510175, 1.7309231855869918], [2.4955885715691313, 0.41857175613807973, 3.0774924248919198, 3.6642729300305166, 3.5910673624832974], [0.11946033180837676, 0.5510206447585608, 0.19804669791609106, 0.23596652247850727, 0.4336613685413166], [2.5910614251952118, 0.18910006720923211, 1.801117611577243, 3.27368681446306, 3.4268706575210093], [1.276635806403494, 0.6186948990920382, 0.7530083276296426, 0.3479732588854668, 1.096049112808554], [1.3553629794068631, 0.7569112411235088, 0.7754015524006495, 0.9562995855903482, 1.3519400744520083], [2.611654308864723, 1.988873067286298, 1.1883364613311096, 0.8502280014334246, 2.6566013035930225], [0.40048569707228765, 0.963492645676801, 0.024764641644906993, 0.06370327008833737, 0.18322186263998452], [2.787207573513514, 2.3988523707647316, 1.41526477352392, 0.841725508374745, 3.3572164341461557], [1.655082518626703, 0.20480219729737015, 0.5174078773615083, 2.0383846319292713, 1.2679200826507875], [1.6422963694305144, 1.1016635730063906, 0.7589260932970048, 0.30871853167807006, 2.5167467978816003], [2.243501066899484, 0.20105569266519818, 1.7035032522154159, 3.0516910652661133, 2.6437215132613785], [0.24271217239086162, 0.659352001397997, 0.16999095519795424, 0.5379672774409605, 1.1169567838101562], [1.819797675764525, 0.2885215851259334, 1.8297544242764472, 3.952815466956758, 2.568940723014131], [1.5975366888108031, 4.759456183472207, 10.545834011318274, 9.183148091959163, 9.398757825871046], [19.855136634074285, 1.3922061905685736, 1.4668265547151078, 24.77263197576111, 4.071829623957766], [2.0762265669624034, 28.94489792430176, 18.66591599745064, 0.34367035967261894, 16.26322815104568], [28.633099745583994, 5.96482580689875, 23.20516505766583, 7.5646349980280405, 8.999592921010015], [15.307293329771744, 2.9186535530167856, 21.666942911398007, 18.346581315046723, 21.64919798520486], [6.53690547410493, 14.083434892815465, 2.228963780191455, 25.968342053823097, 13.845546870050178], [12.60672654625206, 8.224889804938927, 20.520690746692345, 7.941928356195343, 2.5479180827836587], [15.009512627014516, 6.703972201066839, 6.41920738182519, 8.321212365321376, 14.75692759699853], [31.31970994145971, 12.32254692700142, 11.899569807792547, 28.24145700187062, 5.645742196829322]]                                                                               [[0.09650156657968634, 0.336147089040892, 0.005355747608690883, 0.03714864777550417, 0.19936430888257553], [0.2677669732097545, 1.3685670768848686, 1.4688430638917702, 0.7638217645315433, 0.1449667820548457], [0.003423672986829329, 0.8669253676683297, 0.7150809389917206, 0.8065747346939014, 0.12697889044936328], [0.05568348653126165, 0.05046034433406783, 0.7359666089752426, 0.5645500231113174, 0.09409026072222793], [0.05310855881458765, 0.7739581869591947, 1.4271365829253033, 1.360476897247615, 0.27613995865235297], [0.22340885931882226, 0.8291049651898137, 0.537721109986606, 0.922974463157152, 0.5465159902320433], [0.12740574203745414, 1.2718236689384363, 0.7789046581369434, 1.9156762217079983, 0.6368411920283992], [0.3983342128034323, 0.8677197197384572, 1.007096787723749, 0.46442030081767194, 0.7420361436121982], [0.19728803557054242, 0.6268459643363193, 0.3209038632359492, 1.5078038736253898, 0.06007631365115096], [0.3800995194768326, 1.3402320026739336, 0.675805803702711, 0.8904867975825177, 0.4293695249356002], [0.5161628237496476, 0.5803673769219383, 1.1012352667959542, 1.6297635125379855, 0.5795749238250815], [0.40443977596415603, 0.3924893391143785, 0.37522855193220156, 1.0625458278492457, 0.5985881454083619], [0.09488980398795621, 1.1747067583794082, 0.5720301513585866, 0.1199435974867061, 0.15230963916346807], [0.04023543707256794, 0.8809805897605225, 1.4425652067917376, 1.102197279485237, 0.04058567773189714], [0.41178120494995507, 0.8299163872311006, 0.48238435996694706, 0.4073834322393125, 0.8206416295028766], [0.28743489125280597, 1.4636099289625266, 1.4270243680829058, 0.9435418041666339, 0.5520450977397986], [0.18836278914333104, 0.3459206324896577, 1.7034607531163155, 0.8567412304327442, 0.7306212581401247], [0.34917599063129123, 0.3528136033590605, 0.637241623854001, 0.9443002306780022, 0.811354325160481], [0.01634822164778016, 0.7577057122455623, 1.1889606487531725, 1.1558503383991205, 0.31328154985060663], [0.3852994264610492, 0.306992384459824, 0.6900575577131933, 0.7965422386547799, 0.9993044577618718], [0.07168984346918039, 0.7454839154442375, 0.9596112821813825, 2.0038819653582087, 0.646155719993092], [4.364850933299208, 4.8326963798311695, 12.73573311724895, 9.186730615252088, 8.311423873061525], [6.136112669399935, 0.1047225078828159, 0.23477659572740006, 28.111242125319446, 6.118763827507391], [6.717603857380768, 29.347880588254927, 20.885121873945167, 0.010588944579853377, 14.33155604248396], [10.29570048028462, 6.936532401408017, 23.624020150638977, 10.673994711680288, 20.447769690122833], [5.589489651064341, 2.4301773720614244, 19.85558666140021, 19.250704252346722, 13.17748935850602], [9.169236123396933, 13.995937343850223, 3.2849197385628455, 26.172829290706556, 13.570825858086925], [0.5356358895005009, 6.73429339792069, 19.210387172993276, 5.330907725340676, 4.625312623697789], [9.399684223084853, 6.234960966930079, 5.646999520447232, 9.219625362465338, 17.592267220185928], [5.645164628279279, 12.82801835530593, 11.414259638055395, 30.020060240665266, 6.581396534881257]]                                             1                [185.85151482234434, 118.70376972268397, 156.47231950654572, 185.0769863358365, 124.92159794168484]  [2.7563052198791143, 2.3611815594402663, 1.5944085596202033, 2.2619790195622334, 1.7552278326099218, 1.0091808146161731, 3.1492641093031293, 1.318630237350014, 2.177839627994287, 2.017440871051296, 2.9701514490481875, 1.8448727169163774, 2.4252341801065964, 1.7234525680270965, 1.659051100426757, 1.6264622722734103, 2.893857006421137, 1.7425436062705564, 1.7306707978020996, 2.291165999007744, 3.3180348169266805, 43.105048944699185, 73.61734135692356, 79.66658796052194, 90.44852504712837, 73.72083409088813, 89.49431270548502, 41.82721551159135, 69.71182262906709, 78.74188247780664]        1\n",
      "[[0.4742415323107961, 0.2729328058610238, 0.43546386383209273, 0.3778658320426913, 0.19649667616941133], [0.17401720794983178, 0.104755633022683, 0.7141567862039968, 0.2187331660399095, 0.21589642012208288], [0.10221796123045884, 0.7161493260868453, 2.690637385860576, 1.2792406375068712, 1.4712984622836878], [0.042968922328092296, 0.247143304260757, 1.1440132478913183, 0.32195261600602776, 1.1909877141077874], [0.8860607905273212, 2.0465730160054796, 3.9163626437844785, 1.0863623321760592, 3.152134366180613], [0.6486859647166854, 1.0825765508139789, 1.4081570882343946, 0.031704948384810555, 1.3846854676495224], [1.0957991705488563, 1.1680553319955218, 4.981384090599736, 1.636500027158467, 3.91625533062589], [0.739137991189099, 0.6538241009370539, 1.3307225024634664, 0.8946731196717367, 1.865984881772898], [0.9425526408687713, 0.09647425227022827, 3.8633878643515374, 1.7000628038936267, 4.539460734006806], [0.24757108949204382, 0.055539535463935856, 0.40858030640835397, 0.16918032804126532, 0.3302457020972138], [0.32156050788732216, 0.9836247977413344, 2.8001219158714488, 0.8970737598615826, 3.128911481207733], [0.7534548312853917, 0.3083312590908879, 1.095350458211459, 0.6078020871924771, 1.8597315046553053], [0.8180165735468277, 0.6774013280637916, 0.6466506476622502, 0.9147926730302331, 1.1964641509595677], [0.2216615112755823, 1.8556599806110512, 2.615051576357126, 1.1307761923121495, 3.8320891507655563], [0.21161573239119322, 0.3994765513575476, 0.5148040938699169, 0.5386472502304909, 1.483273472011874], [0.5856524633283844, 1.5850648425826133, 2.0804028398495094, 0.5964590008755781, 3.271167866257843], [0.5015816219540206, 0.6070005710557089, 1.7814897573708315, 0.9510472297200219, 2.858222021197272], [0.3417793368325306, 1.3634552624165142, 1.2821670134043084, 0.7594043647692488, 1.9281032782024439], [0.5710175518317702, 0.6304205907936429, 2.058138733146349, 1.705630965894474, 4.292099059118428], [0.9072398937761035, 0.7551987267106841, 0.6092684449875558, 0.19465755891499692, 1.1245170455973872], [0.8285514835250055, 0.30441135268262187, 2.919342171998089, 1.5086595168638255, 3.1002090288091746], [9.515331687854928, 9.05356010887206, 11.431930353351577, 11.334672276208702, 20.942189678095747], [12.19673472391636, 10.416853189458823, 0.7269256972186957, 25.38754257677281, 4.329357595980065], [6.184417275418065, 25.396159779856163, 15.44683693608459, 4.044368509516803, 19.566396402039377], [22.325929438194606, 0.45269934902146014, 11.991351894547108, 11.627863809764786, 5.844732357234383], [27.927832901005075, 5.715916532264459, 12.048635052169445, 14.251832561119478, 23.608223489616165], [2.229058424714748, 10.348303738474963, 12.728440143758327, 14.48752958618449, 10.898721137854315], [16.303022010440174, 4.321158855265036, 9.91371525147721, 11.561884766926815, 4.463759430633406], [11.599146081231034, 5.771343960313821, 0.11159176071507423, 8.18761924483643, 8.31136664489828], [24.783708462408505, 19.724909369512673, 15.899686700084569, 42.2089821034099, 3.87166308971349]]                                                                         [[0.1284835445989977, 0.2909773060595233, 0.4507245003509237, 0.380950319419271, 0.3998954552410958], [0.14007669240795062, 1.1814708850796545, 1.2822340828093188, 1.348826429397888, 0.20585828277138418], [0.07826824171948937, 0.5251444122060488, 1.2190768918535564, 1.1162203295992388, 0.2853006233898675], [0.29151191144275557, 0.5947795744613373, 0.4928415058325891, 1.0883606146225036, 0.26414814859280056], [0.030019053512247984, 1.6882829804345518, 0.9899239749126272, 0.8157400775766819, 0.20187922725574803], [0.3141812735802464, 1.0313229896811957, 0.7686422456960684, 0.03701106667062362, 0.5016925870673408], [0.13255709021732875, 0.8381184790317234, 0.7563581129417899, 1.4270836150944677, 0.001833875502617932], [0.16635734517559947, 1.1712807914909988, 1.0583426977593322, 0.3935730445750213, 0.2466246702870641], [0.06579153226385315, 0.420279366141479, 0.7517806827257052, 1.4537256355323418, 0.2461789875576731], [0.20094812745559743, 0.7668396486506298, 0.5314031686076993, 0.6017447347306847, 0.17704506712747653], [0.15618962784272972, 1.1762726268863064, 1.0619534263037038, 0.7438373578381963, 0.08597824475979132], [0.08033540285470431, 0.3673954924148559, 0.5954186194616802, 1.1390770228354923, 0.03658674360368985], [0.41117207131665034, 0.8162845498061329, 1.1660030850230196, 0.8024959838613804, 0.5525001233937754], [0.3223655497975464, 1.329081963438227, 0.9799900157014356, 1.589480926217249, 0.46543649518452], [0.3285074112479141, 0.3800355880088274, 0.1903118027664313, 0.5125455426560213, 0.801044132473831], [0.08603776157934262, 1.2395159909915996, 1.7422275822213873, 0.8600150375235327, 0.10921750402507191], [0.015497462039700816, 0.7222047845264776, 1.1654105559528014, 0.898871963025442, 0.25863387293978707], [0.053515647733974214, 0.9563591624905827, 0.686513419828247, 1.118296365271323, 0.01625371689931654], [0.09232142995728898, 0.9727613304505388, 1.8678926378857128, 1.4251253304338263, 0.6522439257110211], [0.42132427420317486, 0.38528625068969874, 1.1490221517714279, 0.08259514105601894, 0.9641225371128348], [0.315877613975853, 0.7238198018025138, 0.9035430353975806, 1.1787206416514984, 0.30685618998201536], [6.5294029287415505, 9.143177343114226, 12.97465637467321, 12.813899409942465, 14.71561950113253], [1.8065533993013343, 9.715661410664028, 1.5685378675791655, 26.964455649526535, 1.6099299546419754], [10.548126447665801, 25.691893694184834, 17.630861901735447, 3.368342194569887, 19.44403410424004], [9.29255484730824, 0.5277723439642468, 14.733133788399993, 12.853435099273556, 14.053986034638925], [5.69923839809821, 4.274929162141448, 11.312783475747745, 9.996086000449722, 7.737663983425868], [1.4092979632892217, 10.467464125193969, 14.156439174839345, 14.896182311673659, 8.032120685599159], [4.602153262928097, 3.459386842000034, 10.081056026427497, 11.338324739478153, 10.323419225683091], [4.992126802104, 5.555665875187691, 0.24445484100498321, 7.820570296900165, 11.38252340932147], [9.710122829952848, 18.99904934675786, 15.970124991635409, 42.887960023637696, 10.96715978838333]]                                               1                [184.877319463517, 118.89878699451953, 112.18970084785585, 202.99476042785022, 136.48442534958428]   [1.8559008973641555, 1.4110950451544897, 1.4681444631889848, 1.5714336366523403, 2.5386026961610137, 1.8757250120065507, 1.701028111626896, 1.6081718155314795, 1.6333305087762033, 1.4800476961189852, 1.6523715581751115, 1.597738118897247, 1.556463187395471, 2.010823293653581, 2.0360816408186877, 2.156256974608611, 1.609280828550005, 1.5327071744036986, 3.0411289272811524, 2.5809349865618483, 1.4535132636147048, 63.80791082749012, 59.552339455307276, 89.20781258847221, 75.50873794722268, 47.95638828837181, 52.29033376409495, 47.17204513365078, 44.07135864382392, 120.70542455581268]       1\n",
      "[[0.461209940391607, 0.272716614898264, 0.006162989258057691, 0.4953713559247196, 0.4048628521032126], [0.7067971557116957, 0.01811439443274495, 0.01814733270842303, 0.0039624969960593, 0.1424938702825606], [0.06930513834344165, 0.535288766223991, 0.7698140990051601, 0.08314460908935861, 0.5812826691080738], [0.21562840123758892, 0.22873773507035317, 0.37067824701811364, 0.05869025927058408, 0.6770646889038272], [0.41605403307361555, 1.2171716961388985, 1.734584947987272, 0.6384476304916202, 0.05245504018900643], [0.3718405960032314, 0.7261122706076906, 0.7534356501528088, 0.6298251842421654, 0.5140987871987486], [0.5543676420335897, 0.7340624005208788, 1.4807298910239113, 0.7456338941177639, 0.5548673000399568], [0.31059878591108747, 0.8143142519924328, 0.23994610528926213, 0.45769101066134305, 0.05834385184265717], [0.12002712591544618, 0.8107293561789085, 0.2172354050062818, 1.2486610514154437, 0.46546324625596713], [0.3945539801137131, 0.20428725513294035, 0.06023629596334296, 0.3512108083234044, 0.18110427936127477], [0.38441521565103276, 1.83144747166798, 1.2509839812533867, 0.3926177668503821, 0.23177818851969556], [0.1784660472183749, 0.3498470177789412, 0.9483008370105644, 1.3500897453774097, 0.5755973534118075], [0.02300232274074987, 1.146914163173812, 1.0443018132115034, 0.1467542142660032, 0.6684300769502314], [0.021745190261236447, 0.5007854148403393, 0.8992229234722188, 1.5484518376636411, 0.023767492410007862], [0.36220445039489274, 0.34125739001641137, 0.4261288202857474, 0.2370546243565242, 0.8853559562592388], [0.37400118376871183, 0.86204027856148, 0.7392181312915975, 2.1737634451298886, 0.6122539563753407], [0.10266236427909692, 0.8076131999361824, 0.27640848813581864, 0.3146335184605338, 0.6612000184177378], [0.09569480238089234, 1.2153790167185268, 0.17786748300746227, 0.813599351515846, 0.9955838110005967], [0.4915266154181275, 1.5297635163547383, 0.40704023707078973, 0.5865861217668702, 0.4746192528736263], [0.3018986200561539, 0.03817401361597027, 0.3804195534294197, 0.39545675150491333, 1.0358865425647896], [0.16814873518515872, 0.8172208773992623, 0.25617952713841374, 0.7730337740574453, 0.39845443606851083], [0.6115967840929363, 0.410444462974191, 0.22352951663081355, 0.34906344708850257, 0.5903296776065925], [0.7511720287167212, 0.6599309333090666, 0.5036627810022264, 1.4196037284351073, 0.32086733701245906], [0.575535419346797, 0.6664706832628025, 0.3304397850235745, 0.8782286722271517, 0.13436013499487653], [0.8320349113201454, 0.3464321757534034, 1.9336930803553576, 1.1995583397729535, 0.6961787850688834], [0.017432328246951845, 1.3921789339178325, 0.3226981859333362, 1.0472483918958775, 0.03095540086097981], [0.30170123796442594, 0.6153571057238454, 0.9827758325434801, 0.4503138979202626, 1.255586117457491], [0.6944804695848982, 0.5106451394575099, 0.1984874509889445, 0.7057709601281057, 0.058021455255495194], [0.888529211767098, 0.4242181200785949, 0.39824306549948646, 0.16023911058461346, 0.9182787020820583], [1.059664423729159, 0.06357937877169545, 0.5210209916040395, 0.13725361965478908, 0.6837978345021376]]        [[0.09337611735170293, 0.2591430469796518, 0.00383763180304339, 0.4762255133480914, 0.09500107098400717], [0.21997804254932918, 1.2074869761289644, 1.0646511209146619, 0.9195651986817652, 0.06810705526585314], [0.2674945217334571, 0.5579321038778657, 0.572666470493938, 0.3161430274535373, 0.5615708508356514], [0.03279705243708819, 0.4391281554313876, 0.14790045130170593, 0.5487613070012981, 0.21921386292919248], [0.1442828979341817, 1.2555084094395736, 1.3789931099570072, 1.030853531044945, 0.1602676878774213], [0.1820143646957456, 0.9341527397266746, 1.1589371644511701, 0.23357814797033666, 0.24281785097394215], [0.25538055614916044, 0.9455395408348599, 0.8392648725773472, 1.4151467843651833, 0.7621485859945037], [0.3007476741380517, 1.5566328809661245, 1.1331684955366303, 0.40580655105347185, 0.3161001120223874], [0.04592110857363574, 0.5318711374728519, 0.5258099285696607, 2.021819621822721, 0.37815927585119513], [0.25722243969749864, 1.0459116259963235, 0.8991354390194759, 0.46021502316538465, 0.26644323357693117], [0.016350052972524898, 1.5256075431893477, 1.935573836010594, 1.091558187642662, 0.4121994131096779], [0.4046298891073359, 0.03951320860716163, 0.8245117058359765, 1.3880072261313863, 0.5940527047373676], [0.36153611218974835, 1.0570102584001273, 1.3015180096681374, 0.3913929929224304, 0.5382446228374352], [0.06028479266814424, 0.48069854278365853, 1.2728458292974003, 1.1388043607041267, 0.03600049198412725], [0.38224849034834507, 0.4116957660087073, 0.5582019825091811, 0.10955098444751449, 0.8157422858448518], [0.23520653542781256, 1.0311422558961432, 1.3181726302569428, 1.5445427762224357, 0.608962894200641], [0.17978906490425217, 0.5481441643845786, 0.8334929922162991, 0.9024237682691834, 0.6187328011208132], [0.30068424567166674, 1.088609597317342, 0.09143256248756654, 0.7268429368562245, 0.7154207508034274], [0.164133302776859, 1.3576800367930535, 0.9686098907866649, 1.1554378010396475, 0.6207965534823091], [0.26951768238592505, 0.44437912383188344, 0.7843396241150165, 0.7683756565790595, 0.8071021513338396], [0.2634271652357374, 0.7185275393638914, 0.2538128871031412, 1.3251471186370412, 0.24230483001010406], [0.20176688077605154, 0.9456995498209119, 0.9455477618208604, 0.3532826981354757, 0.6232138791256545], [0.38241046762838815, 0.6979666017645445, 0.21077466901777553, 1.7595390046842712, 0.4353629588936674], [0.15594680744642853, 0.7913932541030778, 0.6854455819265647, 0.5350568527066297, 0.30538813516153873], [0.4881664159708663, 0.41753341117749243, 1.6287849189051198, 1.5515087949891255, 0.7963854059355837], [0.22646479817528387, 0.9377424232415041, 0.07300678103218108, 1.2313896337563706, 0.23477301725998423], [0.651335233682551, 0.7964544281292144, 0.7102672987376148, 0.6970435625439857, 1.1866883049005303], [0.22798482126496555, 0.5156869220147887, 1.107029463975574, 1.5115910469830856, 0.017217691336260277], [0.6431317416381992, 0.8115084489203237, 0.005495829153780104, 0.24656558316476118, 1.1880159847081044], [0.11403825163390913, 0.9651235206328068, 1.4643046452022295, 0.6883859174046286, 0.5789518184984166]]     0                [5.277801826786314, 5.690847682217466, 6.210177945808102, 6.972855807027882, 6.2229681134913974]     [2.4197900813306092, 1.94786613808706, 1.3622334511307665, 2.1965419660050793, 1.5440503691871958, 1.812480575249519, 1.9528957856291547, 2.3228726812578593, 2.875405857697659, 1.549507853198584, 2.9758493344123003, 2.5627929209458666, 1.6679666093312895, 1.7905537332281565, 2.0482780991873386, 1.796902313501064, 1.3924217821596512, 2.2694252158219532, 1.9971236250806053, 1.752128886956888, 1.927484501796512, 1.4827236744056935, 2.751944464490283, 1.0532083705001134, 3.2148288025626384, 2.2084392306055878, 2.8123114868464576, 2.375074861092791, 3.3088411075591946, 2.007878524556524]     0\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: The `gcloud ml-engine` commands have been renamed and will soon be removed. Please use `gcloud ai-platform` instead.\n",
      "WARNING: 2019-07-12 20:43:15.013952: I tensorflow/core/platform/cpu_feature_guard.cc:145] This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical operations:  AVX2 FMA\n",
      "To enable them in non-MKL-DNN operations, rebuild TensorFlow with the appropriate compiler flags.\n",
      "2019-07-12 20:43:15.025838: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
      "2019-07-12 20:43:15.027276: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55b0dc3b92d0 executing computations on platform Host. Devices:\n",
      "2019-07-12 20:43:15.027327: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>\n",
      "2019-07-12 20:43:15.028499: I tensorflow/core/common_runtime/process_util.cc:115] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.\n",
      "WARNING: Logging before flag parsing goes to stderr.\n",
      "W0712 20:43:15.028918 139777310832064 deprecation.py:323] From /usr/lib/google-cloud-sdk/lib/third_party/ml_sdk/cloud/ml/prediction/frameworks/tf_prediction_lib.py:210: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function for importing SavedModels in Tensorflow 2.0.\n",
      "W0712 20:43:15.154814 139777310832064 deprecation.py:323] From /usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py:1276: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use standard file APIs to check for files with this prefix.\n",
      "2019-07-12 20:43:15.215655: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "model_dir=$(ls ${PWD}/trained_model/pca_labeled/export/exporter | tail -1)\n",
    "gcloud ml-engine local predict \\\n",
    "  --model-dir=${PWD}/trained_model/pca_labeled/export/exporter/${model_dir} \\\n",
    "  --json-instances=./test_sequences.json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
